Compare commits
560 Commits
feature/IO
...
rome/test
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
82fbe74723 | ||
|
|
1f2da44a3f | ||
|
|
85a3aeb335 | ||
|
|
80b7ae0e54 | ||
|
|
0529ac4478 | ||
|
|
3cafbebbee | ||
|
|
6f248d864e | ||
|
|
a4a84572b7 | ||
|
|
a45d0bb9f4 | ||
|
|
a2e0f9fbe7 | ||
|
|
e37dc0a18f | ||
|
|
0bc00d46cf | ||
|
|
e80e40bb76 | ||
|
|
a88c102b27 | ||
|
|
c691d44c44 | ||
|
|
ebb3a13ff5 | ||
|
|
3846b7c5fc | ||
|
|
93d139f926 | ||
|
|
4d1f40537c | ||
|
|
896f1415f7 | ||
|
|
8a01cd9cb0 | ||
|
|
c2013d47e7 | ||
|
|
0f20807690 | ||
|
|
2a45be6a45 | ||
|
|
b63602143e | ||
|
|
2add712270 | ||
|
|
77c8f74bcb | ||
|
|
1d38102541 | ||
|
|
6117b5ab64 | ||
|
|
578f0a110e | ||
|
|
b5c66274ca | ||
|
|
be46bdc57f | ||
|
|
6263e63a1d | ||
|
|
83d702f12b | ||
|
|
37708a0b59 | ||
|
|
6cfcab8156 | ||
|
|
67bcae3c5b | ||
|
|
da65f39d28 | ||
|
|
929854fd55 | ||
|
|
9e216bb3ad | ||
|
|
4bfee3c135 | ||
|
|
6187b19e91 | ||
|
|
54df4a7f8c | ||
|
|
33ec18986d | ||
|
|
6b7b34ae79 | ||
|
|
06ef2482ba | ||
|
|
83bd485597 | ||
|
|
6921f2fe68 | ||
|
|
a7e199932c | ||
|
|
2427c14b7b | ||
|
|
66655d449e | ||
|
|
845a84c4c8 | ||
|
|
0ff5ea3d59 | ||
|
|
09492e647e | ||
|
|
2d6594cc73 | ||
|
|
3b8e83d88a | ||
|
|
3ec4dbb5b8 | ||
|
|
601fdbba39 | ||
|
|
830adc4ef3 | ||
|
|
3f216195ca | ||
|
|
bcb8de0937 | ||
|
|
9cc0d6175e | ||
|
|
4c07632ee6 | ||
|
|
767c219af8 | ||
|
|
cfc301570e | ||
|
|
fb718f9f37 | ||
|
|
cafc0e5628 | ||
|
|
a635725839 | ||
|
|
eb8e9b10ef | ||
|
|
2584f7129c | ||
|
|
771f75788a | ||
|
|
89bc11e4ad | ||
|
|
b8880e8cb8 | ||
|
|
6c996037d6 | ||
|
|
f421b45222 | ||
|
|
30cf46a158 | ||
|
|
8d37c54f89 | ||
|
|
f9b9f39418 | ||
|
|
05a5df789b | ||
|
|
bed87eda97 | ||
|
|
67008c35b8 | ||
|
|
9b95e40a13 | ||
|
|
e3a998b6f8 | ||
|
|
3c7ede0155 | ||
|
|
82c7aa1347 | ||
|
|
4ccd912363 | ||
|
|
c0525842fd | ||
|
|
dd5ca5d233 | ||
|
|
616a4b04a0 | ||
|
|
9a34640c88 | ||
|
|
3110be4703 | ||
|
|
971c8d41ff | ||
|
|
7c303a5154 | ||
|
|
9383b37a41 | ||
|
|
205d507097 | ||
|
|
97a1bd66d1 | ||
|
|
0d1ff6390c | ||
|
|
830d2c87d2 | ||
|
|
da98e7b886 | ||
|
|
a74a9ba5a1 | ||
|
|
b8a3081488 | ||
|
|
c8fc1b0f68 | ||
|
|
da1ddb874f | ||
|
|
771f9ceaa8 | ||
|
|
9b61da5c62 | ||
|
|
7daf7540b3 | ||
|
|
ce6940629d | ||
|
|
b706b96d32 | ||
|
|
2427bc72f2 | ||
|
|
8bc1a9d9ee | ||
|
|
618107fc63 | ||
|
|
0879cb602d | ||
|
|
d5198edfc0 | ||
|
|
647c796497 | ||
|
|
39bba3623a | ||
|
|
8687aeb9bf | ||
|
|
62dac2193f | ||
|
|
22feaf6c77 | ||
|
|
72da0734c8 | ||
|
|
e72f42bda2 | ||
|
|
69b4b76501 | ||
|
|
ae56e27e5f | ||
|
|
12d0a9ec78 | ||
|
|
d6bb6a891d | ||
|
|
ba30225ba1 | ||
|
|
cb4a6e8774 | ||
|
|
2f83b0baa7 | ||
|
|
23f640028d | ||
|
|
04728690ca | ||
|
|
3e5e6263fe | ||
|
|
48cef3e188 | ||
|
|
8c0d6b2f6b | ||
|
|
22ee8acd0d | ||
|
|
afdcfb7bf6 | ||
|
|
c1f6d06128 | ||
|
|
120a8a4576 | ||
|
|
89224e871c | ||
|
|
fa0d472fb6 | ||
|
|
b0f4ad7e4f | ||
|
|
7503d86c69 | ||
|
|
efd1c17033 | ||
|
|
c7a0072f2d | ||
|
|
908942ec09 | ||
|
|
e4d3b53349 | ||
|
|
2a31d740d5 | ||
|
|
03ce5458b5 | ||
|
|
61c03ee206 | ||
|
|
0e4f5b8b2a | ||
|
|
b5d4944ad8 | ||
|
|
50f84d40e1 | ||
|
|
a394d6b37e | ||
|
|
f8408908b2 | ||
|
|
eb8519dc1d | ||
|
|
36dd97394f | ||
|
|
03d4e4dcd1 | ||
|
|
6489a8666f | ||
|
|
5ea64ed805 | ||
|
|
d740446ccb | ||
|
|
d0a2bb7da0 | ||
|
|
5de4ef5d83 | ||
|
|
f59bdf9030 | ||
|
|
cfe0727447 | ||
|
|
09d112350a | ||
|
|
52f8eabd2b | ||
|
|
a162b275a3 | ||
|
|
2e7232bb65 | ||
|
|
82dc9e1c56 | ||
|
|
272a3f579a | ||
|
|
ff1ceb20cb | ||
|
|
343179d4fe | ||
|
|
eabbc2211b | ||
|
|
7f587680ca | ||
|
|
d61ed03ef1 | ||
|
|
166efdc877 | ||
|
|
9274742520 | ||
|
|
9b4c85c9e3 | ||
|
|
66c64ce9e0 | ||
|
|
c9cbffdec8 | ||
|
|
ca3145ce0f | ||
|
|
52f9106776 | ||
|
|
1a2cc5623d | ||
|
|
d06037df1f | ||
|
|
cb8632641e | ||
|
|
adbfcddd9d | ||
|
|
e3aea55e91 | ||
|
|
bf6b1c202f | ||
|
|
0cab47f984 | ||
|
|
829e611692 | ||
|
|
e0e62a52be | ||
|
|
23c0f8e383 | ||
|
|
764a89e5bf | ||
|
|
f4908ed265 | ||
|
|
fcd9c19f0b | ||
|
|
430823dde0 | ||
|
|
7e919a7221 | ||
|
|
7e7f055c34 | ||
|
|
6e04ed7c83 | ||
|
|
5ec07f9620 | ||
|
|
d3da4a8a1e | ||
|
|
9ee10dc5f8 | ||
|
|
572963d987 | ||
|
|
636be8989e | ||
|
|
dea7fd71ef | ||
|
|
be08ed8551 | ||
|
|
65ce588287 | ||
|
|
0cc367b25e | ||
|
|
2ce8549502 | ||
|
|
7245d4eab2 | ||
|
|
260607cb72 | ||
|
|
810738539b | ||
|
|
80539949fb | ||
|
|
ebe5c5b113 | ||
|
|
525182c2a7 | ||
|
|
3704c0cb12 | ||
|
|
c8c844cfba | ||
|
|
4c4e16b0c9 | ||
|
|
69f727c4e5 | ||
|
|
04cff4acb1 | ||
|
|
4e4fcc3ae4 | ||
|
|
485f9d6025 | ||
|
|
a697ade93a | ||
|
|
7db07b5a94 | ||
|
|
9ec50875a2 | ||
|
|
02b6875eec | ||
|
|
e7e4c534bc | ||
|
|
e438fa1d99 | ||
|
|
4abbf50a46 | ||
|
|
3e9279d89a | ||
|
|
1305277c09 | ||
|
|
3c47c672d4 | ||
|
|
258d99cd41 | ||
|
|
83356fa4ef | ||
|
|
25429e78f8 | ||
|
|
ff7523ecb8 | ||
|
|
b53fdadaee | ||
|
|
93390bef63 | ||
|
|
485e2ef4f1 | ||
|
|
9de3b5efb6 | ||
|
|
2632282bba | ||
|
|
7379f50792 | ||
|
|
9ae53d090f | ||
|
|
de90bd1bb0 | ||
|
|
aa6cb4c1d2 | ||
|
|
e871ba600f | ||
|
|
fe3698980d | ||
|
|
677c7bb4cc | ||
|
|
89b640f71c | ||
|
|
d13a9cd04a | ||
|
|
4fdc241b9c | ||
|
|
06ca7603b9 | ||
|
|
28dc4867db | ||
|
|
1cf13da413 | ||
|
|
9c897972ad | ||
|
|
307e244475 | ||
|
|
9d3aca646b | ||
|
|
e6e61466df | ||
|
|
db7f9fe2ab | ||
|
|
ded798fdf1 | ||
|
|
bfe94e3068 | ||
|
|
823f07409a | ||
|
|
73cacdec24 | ||
|
|
b0d077e104 | ||
|
|
ea72d44b42 | ||
|
|
d1b9b5546b | ||
|
|
84f0affaed | ||
|
|
fc4b5c6b1d | ||
|
|
2c232a71d5 | ||
|
|
3919efaa77 | ||
|
|
a76fc780cb | ||
|
|
d915c123db | ||
|
|
f8e1758788 | ||
|
|
5c95c72f40 | ||
|
|
98f816b069 | ||
|
|
3ca6308dd2 | ||
|
|
a2c2aa11ac | ||
|
|
b5b772d0c2 | ||
|
|
4d8a2e635c | ||
|
|
0852d55837 | ||
|
|
4c38ddf3cd | ||
|
|
e15edeadb5 | ||
|
|
422c7baada | ||
|
|
2a2f8e51b3 | ||
|
|
85b1875a22 | ||
|
|
151c9c0add | ||
|
|
f14dc497cf | ||
|
|
89339e1033 | ||
|
|
146a61c9cf | ||
|
|
5250d97935 | ||
|
|
18dce9795d | ||
|
|
7add2bb12e | ||
|
|
756fc07193 | ||
|
|
71a5722b0e | ||
|
|
4507135a1b | ||
|
|
7f2479f597 | ||
|
|
66b97be9d2 | ||
|
|
57909ebc61 | ||
|
|
d1090670a8 | ||
|
|
f4bcad1b06 | ||
|
|
6656708c8e | ||
|
|
bfe3fb2ed0 | ||
|
|
ec21521281 | ||
|
|
e71e671d7d | ||
|
|
df6b0fae21 | ||
|
|
69723a8bf4 | ||
|
|
76d907987a | ||
|
|
241caa6132 | ||
|
|
13b93f6d9d | ||
|
|
77555366f4 | ||
|
|
f3e8132bfc | ||
|
|
7510385cf4 | ||
|
|
e05b72615e | ||
|
|
b3f69d4088 | ||
|
|
8796c8fe06 | ||
|
|
b9a6a98fee | ||
|
|
acc9145d52 | ||
|
|
f9c8f53474 | ||
|
|
004e96517f | ||
|
|
957265b1c8 | ||
|
|
8807e282f4 | ||
|
|
c394974dc8 | ||
|
|
28386a4234 | ||
|
|
6f16c47d4f | ||
|
|
25062e37f4 | ||
|
|
2b1f8e4335 | ||
|
|
02690b6796 | ||
|
|
3897281015 | ||
|
|
8d0e5b93ed | ||
|
|
ef146032df | ||
|
|
1dc025fb36 | ||
|
|
30c0c84b93 | ||
|
|
4bd139f93b | ||
|
|
f59787add0 | ||
|
|
20c304a2db | ||
|
|
53526d9c80 | ||
|
|
68b4bc66ff | ||
|
|
805149daea | ||
|
|
b2529207e1 | ||
|
|
d2fe9b0590 | ||
|
|
eff4f82ad7 | ||
|
|
57327332c9 | ||
|
|
a2144ccb61 | ||
|
|
aa478fc510 | ||
|
|
659a0bc0fd | ||
|
|
f1ef28e544 | ||
|
|
fef680fb99 | ||
|
|
91a45a621a | ||
|
|
fe9512ca9c | ||
|
|
ff318599f5 | ||
|
|
d1ba90408d | ||
|
|
536f8d9cb9 | ||
|
|
6a9e871b08 | ||
|
|
d163d145d0 | ||
|
|
fdf0506976 | ||
|
|
c9d8fc3072 | ||
|
|
0bcf67a5f5 | ||
|
|
3e48753329 | ||
|
|
96441dbb33 | ||
|
|
6a0b63b185 | ||
|
|
9dea43fd34 | ||
|
|
465980dd8c | ||
|
|
03d04fd8d1 | ||
|
|
7d18c9b160 | ||
|
|
c097f98959 | ||
|
|
213d4ad928 | ||
|
|
710b3b00f5 | ||
|
|
d041d03fbf | ||
|
|
24b90e9888 | ||
|
|
4b83e798ac | ||
|
|
468f93f3df | ||
|
|
78d9dd5acb | ||
|
|
6ef7d4653d | ||
|
|
645eb637f2 | ||
|
|
268fdce5ac | ||
|
|
f9f3a05a43 | ||
|
|
8a92919b2e | ||
|
|
dbcd675300 | ||
|
|
4628af0e43 | ||
|
|
b1fedf5904 | ||
|
|
45ec03e615 | ||
|
|
570d36b695 | ||
|
|
b36697054e | ||
|
|
17149fe853 | ||
|
|
15c837f745 | ||
|
|
3f43ff05d0 | ||
|
|
d4dee21383 | ||
|
|
79da904767 | ||
|
|
0821797044 | ||
|
|
ad7ff62b56 | ||
|
|
f148d7d0d0 | ||
|
|
e19e3865e7 | ||
|
|
35f062d4e0 | ||
|
|
01328ba33c | ||
|
|
7caa138184 | ||
|
|
1b8c3f3081 | ||
|
|
3e4f36fb6f | ||
|
|
aedcb973f5 | ||
|
|
26dc720929 | ||
|
|
b5cc1c06df | ||
|
|
786c790307 | ||
|
|
3e8660bb61 | ||
|
|
997aed4ab3 | ||
|
|
f64ea058b9 | ||
|
|
96485ba252 | ||
|
|
a9bdcbcdd4 | ||
|
|
1d7f1cccba | ||
|
|
b002477c0d | ||
|
|
27f1447469 | ||
|
|
ff153cdd81 | ||
|
|
fe16329443 | ||
|
|
744e1cf2be | ||
|
|
ab2cf8c8c7 | ||
|
|
fbd001b797 | ||
|
|
4610be6f15 | ||
|
|
d5e34b649f | ||
|
|
7b49a94edd | ||
|
|
8dfcda6c5e | ||
|
|
756d97a9cb | ||
|
|
c0887dbeb9 | ||
|
|
b8f0ff217f | ||
|
|
cc805781e3 | ||
|
|
9531eca7a7 | ||
|
|
d7a1d5bbd2 | ||
|
|
c214168dcd | ||
|
|
dd085be5c7 | ||
|
|
bd7fbfff37 | ||
|
|
52a25fc720 | ||
|
|
384153d914 | ||
|
|
511ac5068b | ||
|
|
67e490ab53 | ||
|
|
b84cde1633 | ||
|
|
3350f7bd56 | ||
|
|
7510419836 | ||
|
|
7da3ef4e0c | ||
|
|
4c32171fbb | ||
|
|
470f178cde | ||
|
|
f9633505a2 | ||
|
|
de102d9898 | ||
|
|
9d503b12e6 | ||
|
|
4dc3bc1532 | ||
|
|
50da8cfbc6 | ||
|
|
bccfc127f3 | ||
|
|
2332d8756d | ||
|
|
a4abaed30a | ||
|
|
d47e18df1f | ||
|
|
c2d094da35 | ||
|
|
6e54b10239 | ||
|
|
e6c44ec52a | ||
|
|
39b8ecf785 | ||
|
|
d87f871334 | ||
|
|
07cea56e2b | ||
|
|
dbf3226f97 | ||
|
|
4b926edf24 | ||
|
|
ce0fd42995 | ||
|
|
bdf91443e0 | ||
|
|
68f4237e15 | ||
|
|
81fc747c03 | ||
|
|
3a25ed13b9 | ||
|
|
21c5eb6786 | ||
|
|
e85203e429 | ||
|
|
6b2d10d589 | ||
|
|
3d03de193e | ||
|
|
a56de72a6b | ||
|
|
0849bbbba6 | ||
|
|
0cd41d2036 | ||
|
|
a93bcd6ab6 | ||
|
|
77b72e160b | ||
|
|
b32c37f4af | ||
|
|
d0beea5cb3 | ||
|
|
30df6887c5 | ||
|
|
bc7823dda1 | ||
|
|
cbb195a313 | ||
|
|
097dc06c65 | ||
|
|
b06fbd25a0 | ||
|
|
89bbf274e5 | ||
|
|
d854177e5a | ||
|
|
aa9f82f2d4 | ||
|
|
2b45264628 | ||
|
|
4da299f431 | ||
|
|
9f9aa447a6 | ||
|
|
6a9f1597cb | ||
|
|
cddc48b851 | ||
|
|
84ab6d300c | ||
|
|
3c5026c2fb | ||
|
|
c3c8959d2e | ||
|
|
2c459d2636 | ||
|
|
a33c481dd5 | ||
|
|
d6b2f93e54 | ||
|
|
802e945829 | ||
|
|
a4a885f33a | ||
|
|
3380cebb28 | ||
|
|
21ed415f4f | ||
|
|
51dd89d36a | ||
|
|
bad96f231c | ||
|
|
184d72c444 | ||
|
|
6ca773050f | ||
|
|
648e8aaae0 | ||
|
|
ad9868b575 | ||
|
|
d4d10998f8 | ||
|
|
ba22c31deb | ||
|
|
f6be133a78 | ||
|
|
3768164f1f | ||
|
|
8465e7539f | ||
|
|
542eca5867 | ||
|
|
27a67c5f4a | ||
|
|
e00c40f2d5 | ||
|
|
b664e231dc | ||
|
|
92d6977f9e | ||
|
|
4059700468 | ||
|
|
196bdd83ba | ||
|
|
fbd52bc14e | ||
|
|
8013c988d0 | ||
|
|
460d6fcf12 | ||
|
|
92353c4853 | ||
|
|
8ca2a89f0f | ||
|
|
f54c2367f3 | ||
|
|
27452085e9 | ||
|
|
2bff7d9567 | ||
|
|
c3749f62fe | ||
|
|
b82c04a16a | ||
|
|
0ec099cdf5 | ||
|
|
d3f49094d8 | ||
|
|
4e2ad3bc62 | ||
|
|
05c287fcf7 | ||
|
|
c11cef4119 | ||
|
|
d6126cc5ce | ||
|
|
d88c925a68 | ||
|
|
372a572400 | ||
|
|
623ee8fbb1 | ||
|
|
729e0fc5ca | ||
|
|
d052cde6ca | ||
|
|
b52bbab903 | ||
|
|
9d42135ebf | ||
|
|
9ce5aa2189 | ||
|
|
e277292194 | ||
|
|
649961c831 | ||
|
|
e00cde2fbd | ||
|
|
25b89d191b | ||
|
|
0a60f77bfc | ||
|
|
66a80e439f | ||
|
|
d8cc25a54f | ||
|
|
39b9cfb348 | ||
|
|
c6087574be | ||
|
|
41c63cbfe9 | ||
|
|
f1afc81e7d | ||
|
|
018f8a19bb | ||
|
|
cccd007ba6 | ||
|
|
6d5b8baadf | ||
|
|
07e36415e4 | ||
|
|
8dc480826b | ||
|
|
533a5b87ec | ||
|
|
7bd83557c1 | ||
|
|
ef290e79b1 | ||
|
|
713b3f4f6d | ||
|
|
8fd9614f69 | ||
|
|
6682a98770 | ||
|
|
392b405978 | ||
|
|
be61850d18 | ||
|
|
f4208a2212 | ||
|
|
0b7278a2a8 | ||
|
|
bee078fe18 |
@@ -42,31 +42,155 @@ jobs:
|
|||||||
app-build:
|
app-build:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:16.15.0
|
- image: cimg/node:16.15.0
|
||||||
|
resource_class: large
|
||||||
working_directory: ~/repo/client
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout:
|
- checkout:
|
||||||
path: ~/repo
|
path: ~/repo
|
||||||
|
|
||||||
- restore_cache:
|
|
||||||
name: Restore Yarn Package Cache
|
|
||||||
keys:
|
|
||||||
- yarn-packages-{{ checksum "yarn.lock" }}
|
|
||||||
- run:
|
- run:
|
||||||
name: Install Dependencies
|
name: Install Dependencies
|
||||||
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
|
command: npm i
|
||||||
- save_cache:
|
|
||||||
name: Save Yarn Package Cache
|
|
||||||
key: yarn-packages-{{ checksum "yarn.lock" }}
|
|
||||||
paths:
|
|
||||||
- ~/.cache/yarn
|
|
||||||
|
|
||||||
- run: yarn run build
|
- run: npm run build
|
||||||
|
|
||||||
- aws-s3/sync:
|
- aws-s3/sync:
|
||||||
from: build
|
from: build
|
||||||
to: "s3://imex-online-production/"
|
to: "s3://imex-online-production/"
|
||||||
|
arguments: "--exclude '*.map'"
|
||||||
|
- jira/notify
|
||||||
|
|
||||||
|
rome-api-deploy:
|
||||||
|
docker:
|
||||||
|
- image: "cimg/base:stable"
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- eb/setup
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
eb init romeonline-productionapi -r us-east-2 -p "Node.js 18 running on 64bit Amazon Linux 2"
|
||||||
|
eb status --verbose
|
||||||
|
eb deploy
|
||||||
|
eb status
|
||||||
|
- jira/notify
|
||||||
|
|
||||||
|
rome-hasura-migrate:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:16.15.0
|
||||||
|
parameters:
|
||||||
|
secret:
|
||||||
|
type: string
|
||||||
|
default: $HASURA_PROD_SECRET
|
||||||
|
working_directory: ~/repo/hasura
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/repo
|
||||||
|
- run:
|
||||||
|
name: Execute migration
|
||||||
|
command: |
|
||||||
|
npm install hasura-cli -g
|
||||||
|
hasura migrate apply --endpoint https://db.romeonline.io/ --admin-secret << parameters.secret >>
|
||||||
|
hasura metadata apply --endpoint https://db.romeonline.io/ --admin-secret << parameters.secret >>
|
||||||
|
hasura metadata reload --endpoint https://db.romeonline.io/ --admin-secret << parameters.secret >>
|
||||||
|
|
||||||
|
rome-app-build:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:16.15.0
|
||||||
|
resource_class: large
|
||||||
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/repo
|
||||||
|
- run:
|
||||||
|
name: Install Dependencies
|
||||||
|
command: npm i
|
||||||
|
|
||||||
|
- run: npm run build
|
||||||
|
|
||||||
|
- aws-s3/sync:
|
||||||
|
from: build
|
||||||
|
to: "s3://rome-online-production/"
|
||||||
|
- jira/notify
|
||||||
|
|
||||||
|
test-rome-hasura-migrate:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:16.15.0
|
||||||
|
parameters:
|
||||||
|
secret:
|
||||||
|
type: string
|
||||||
|
default: $HASURA_ROME_TEST_SECRET
|
||||||
|
working_directory: ~/repo/hasura
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/repo
|
||||||
|
- run:
|
||||||
|
name: Execute migration
|
||||||
|
command: |
|
||||||
|
npm install hasura-cli -g
|
||||||
|
echo ${HASURA_TEST_SECRET}
|
||||||
|
hasura migrate apply --endpoint https://db.test.romeonline.io/ --admin-secret << parameters.secret >>
|
||||||
|
hasura metadata apply --endpoint https://db.test.romeonline.io/ --admin-secret << parameters.secret >>
|
||||||
|
hasura metadata reload --endpoint https://db.test.romeonline.io/ --admin-secret << parameters.secret >>
|
||||||
|
|
||||||
|
test-rome-app-build:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:16.15.0
|
||||||
|
resource_class: large
|
||||||
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/repo
|
||||||
|
- run:
|
||||||
|
name: Install Dependencies
|
||||||
|
command: npm i
|
||||||
|
|
||||||
|
- run: npm run build:test
|
||||||
|
|
||||||
|
- aws-s3/sync:
|
||||||
|
from: build
|
||||||
|
to: "s3://rome-online-test/"
|
||||||
|
- jira/notify
|
||||||
|
|
||||||
|
app-beta-build:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:18.18.2
|
||||||
|
resource_class: large
|
||||||
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/repo
|
||||||
|
- run:
|
||||||
|
name: Install Dependencies
|
||||||
|
command: npm i
|
||||||
|
|
||||||
|
- run: npm run build
|
||||||
|
|
||||||
|
- aws-s3/sync:
|
||||||
|
from: build
|
||||||
|
to: "s3://imex-online-beta/"
|
||||||
|
- jira/notify
|
||||||
|
|
||||||
|
rome-app-beta-build:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:18.18.2
|
||||||
|
resource_class: large
|
||||||
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/repo
|
||||||
|
- run:
|
||||||
|
name: Install Dependencies
|
||||||
|
command: npm i
|
||||||
|
|
||||||
|
- run: npm run build
|
||||||
|
|
||||||
|
- aws-s3/sync:
|
||||||
|
from: build
|
||||||
|
to: "s3://rome-online-production-beta/"
|
||||||
- jira/notify
|
- jira/notify
|
||||||
|
|
||||||
test-hasura-migrate:
|
test-hasura-migrate:
|
||||||
@@ -92,33 +216,67 @@ jobs:
|
|||||||
test-app-build:
|
test-app-build:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:16.15.0
|
- image: cimg/node:16.15.0
|
||||||
|
resource_class: large
|
||||||
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/repo
|
||||||
|
- run:
|
||||||
|
name: Install Dependencies
|
||||||
|
command: npm i
|
||||||
|
|
||||||
|
- run: npm run build:test
|
||||||
|
|
||||||
|
- aws-s3/sync:
|
||||||
|
from: build
|
||||||
|
to: "s3://imex-online-test/"
|
||||||
|
arguments: "--exclude '*.map'"
|
||||||
|
- jira/notify
|
||||||
|
|
||||||
|
test-app-beta-build:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:18.18.2
|
||||||
|
resource_class: large
|
||||||
working_directory: ~/repo/client
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- checkout:
|
- checkout:
|
||||||
path: ~/repo
|
path: ~/repo
|
||||||
|
|
||||||
- restore_cache:
|
|
||||||
name: Restore Yarn Package Cache
|
|
||||||
keys:
|
|
||||||
- yarn-packages-{{ checksum "yarn.lock" }}
|
|
||||||
- run:
|
- run:
|
||||||
name: Install Dependencies
|
name: Install Dependencies
|
||||||
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
|
command: npm i
|
||||||
- save_cache:
|
|
||||||
name: Save Yarn Package Cache
|
|
||||||
key: yarn-packages-{{ checksum "yarn.lock" }}
|
|
||||||
paths:
|
|
||||||
- ~/.cache/yarn
|
|
||||||
|
|
||||||
- run: yarn run build:test
|
- run: npm run build:test
|
||||||
|
|
||||||
- aws-s3/sync:
|
- aws-s3/sync:
|
||||||
from: build
|
from: build
|
||||||
to: "s3://imex-online-test/"
|
to: "s3://imex-online-test-beta/"
|
||||||
- jira/notify
|
- jira/notify
|
||||||
|
|
||||||
|
rome-test-app-beta-build:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:18.18.2
|
||||||
|
resource_class: large
|
||||||
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/repo
|
||||||
|
|
||||||
|
- run:
|
||||||
|
name: Install Dependencies
|
||||||
|
command: npm i
|
||||||
|
|
||||||
|
- run: npm run build:test
|
||||||
|
|
||||||
|
- aws-s3/sync:
|
||||||
|
from: build
|
||||||
|
to: "s3://rome-online-test-beta/"
|
||||||
|
- jira/notify
|
||||||
|
|
||||||
|
|
||||||
admin-app-build:
|
admin-app-build:
|
||||||
docker:
|
docker:
|
||||||
- image: cimg/node:16.15.0
|
- image: cimg/node:16.15.0
|
||||||
@@ -160,20 +318,58 @@ workflows:
|
|||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only: master
|
||||||
|
- app-beta-build:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: master-beta
|
||||||
|
- rome-app-beta-build:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: rome/master-beta
|
||||||
- hasura-migrate:
|
- hasura-migrate:
|
||||||
secret: ${HASURA_PROD_SECRET}
|
secret: ${HASURA_PROD_SECRET}
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: master
|
only: master
|
||||||
|
- rome-api-deploy:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: rome/master
|
||||||
|
- rome-app-build:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: rome/master
|
||||||
|
- rome-hasura-migrate:
|
||||||
|
secret: ${HASURA_PROD_SECRET}
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: rome/master
|
||||||
- test-app-build:
|
- test-app-build:
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: test
|
only: test
|
||||||
|
- rome-test-app-beta-build:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: rome/test-beta
|
||||||
|
- test-app-beta-build:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: test-beta
|
||||||
- test-hasura-migrate:
|
- test-hasura-migrate:
|
||||||
secret: ${HASURA_TEST_SECRET}
|
secret: ${HASURA_TEST_SECRET}
|
||||||
filters:
|
filters:
|
||||||
branches:
|
branches:
|
||||||
only: test
|
only: test
|
||||||
|
- test-rome-app-build:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: rome/test
|
||||||
|
- test-rome-hasura-migrate:
|
||||||
|
secret: ${HASURA_ROME_TEST_SECRET}
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: rome/test
|
||||||
#- admin-app-build:
|
#- admin-app-build:
|
||||||
#filters:
|
#filters:
|
||||||
#branches:
|
#branches:
|
||||||
|
|||||||
16
.prettierrc.js
Normal file
16
.prettierrc.js
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
exports.default = {
|
||||||
|
printWidth: 120,
|
||||||
|
useTabs: false,
|
||||||
|
tabWidth: 2,
|
||||||
|
trailingComma: "es5",
|
||||||
|
semi: true,
|
||||||
|
singleQuote: false,
|
||||||
|
bracketSpacing: true,
|
||||||
|
arrowParens: "always",
|
||||||
|
jsxSingleQuote: false,
|
||||||
|
bracketSameLine: false,
|
||||||
|
endOfLine: "lf",
|
||||||
|
importOrder: ["^@core/(.*)$", "^@server/(.*)$", "^@ui/(.*)$", "^[./]"],
|
||||||
|
importOrderSeparation: true,
|
||||||
|
importOrderSortSpecifiers: true,
|
||||||
|
};
|
||||||
184
_reference/reportFiltersAndSorters.md
Normal file
184
_reference/reportFiltersAndSorters.md
Normal file
@@ -0,0 +1,184 @@
|
|||||||
|
# Filters and Sorters
|
||||||
|
|
||||||
|
This documentation details the schema required for `.filters` files on the report server. It is used to dynamically
|
||||||
|
modify the graphQL query and provide the user more power over their reports.
|
||||||
|
|
||||||
|
For filters and sorters, valid types include (`type` key in the schema):
|
||||||
|
- string (default)
|
||||||
|
- number
|
||||||
|
- bool or boolean
|
||||||
|
- date
|
||||||
|
|
||||||
|
## Special Notes
|
||||||
|
- When passing the data to the template server, the property filters and sorters is added to the data object and will reflect the filters and sorters the user has selected
|
||||||
|
|
||||||
|
## High level Schema Overview
|
||||||
|
|
||||||
|
```javascript
|
||||||
|
const schema = {
|
||||||
|
"filters": [
|
||||||
|
{
|
||||||
|
"name": "jobs.joblines.mod_lb_hrs", // Name and path of the field in the graphQL query
|
||||||
|
"translation": "jobs.joblines.mod_lb_hrs_1", // Translation key for the label used in the GUI
|
||||||
|
"label": "mod_lb_hrs_1", // Label used in the case the GUI does not contain a translation
|
||||||
|
"type": "number" // Type of field, can be number or string currently
|
||||||
|
},
|
||||||
|
// ... more filters
|
||||||
|
],
|
||||||
|
"sorters": [
|
||||||
|
{
|
||||||
|
"name": "jobs.joblines.mod_lb_hrs", // Name and path of the field in the graphQL query
|
||||||
|
"translation": "jobs.joblines.mod_lb_hrs_1", // Translation key for the label used in the GUI
|
||||||
|
"label": "mod_lb_hrs_1", // Label used in the case the GUI does not contain a translation
|
||||||
|
"type": "number" // Type of field, can be number or string currently
|
||||||
|
},
|
||||||
|
// ... more sorters
|
||||||
|
],
|
||||||
|
"dates": {
|
||||||
|
// This is not yet implemented and will be added in a future release
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Filters
|
||||||
|
|
||||||
|
Filters effect the where clause of the graphQL query. They are used to filter the data returned from the server.
|
||||||
|
A note on special notation used in the `name` field.
|
||||||
|
|
||||||
|
## Reflection
|
||||||
|
|
||||||
|
Filters can make use of reflection to pre-fill select boxes, the following is an example of that in the filters file.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "jobs.status",
|
||||||
|
"translation": "jobs.fields.status",
|
||||||
|
"label": "Status",
|
||||||
|
"type": "string",
|
||||||
|
"reflector": {
|
||||||
|
"type": "internal",
|
||||||
|
"name": "special.job_statuses"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
in this example, a reflector with the type 'internal' (all types at the moment require this, and it is used for future functionality), with a name of `special.job_statuses`
|
||||||
|
|
||||||
|
The following cases are available
|
||||||
|
|
||||||
|
- `special.job_statuses` - This will reflect the statuses of the jobs table `bodyshop.md_ro_statuses.statuses'`
|
||||||
|
- `special.cost_centers` - This will reflect the cost centers `bodyshop.md_responsibility_centers.costs`
|
||||||
|
- `special.categories` - This will reflect the categories `bodyshop.md_categories`
|
||||||
|
- `special.insurance_companies` - This will reflect the insurance companies `bodyshop.md_ins_cos`'
|
||||||
|
- `special.employee_teams` - This will reflect the employee teams `bodyshop.employee_teams`
|
||||||
|
- `special.employees` - This will reflect the employees `bodyshop.employees`
|
||||||
|
- `special.first_names` - This will reflect the first names `bodyshop.employees`
|
||||||
|
- `special.last_names` - This will reflect the last names `bodyshop.employees`
|
||||||
|
- `special.referral_sources` - This will reflect the referral sources `bodyshop.md_referral_sources
|
||||||
|
- `special.class`- This will reflect the class `bodyshop.md_classes`
|
||||||
|
-
|
||||||
|
### Path without brackets, multi level
|
||||||
|
|
||||||
|
`"name": "jobs.joblines.mod_lb_hrs",`
|
||||||
|
This will produce a where clause at the `joblines` level of the graphQL query,
|
||||||
|
|
||||||
|
```graphql
|
||||||
|
query gendoc_hours_sold_detail_open($starttz: timestamptz!, $endtz: timestamptz!) {
|
||||||
|
jobs(
|
||||||
|
where: {date_invoiced: {_is_null: true}, date_open: {_gte: $starttz, _lte: $endtz}, ro_number: {_is_null: false}, voided: {_eq: false}}
|
||||||
|
) {
|
||||||
|
joblines(
|
||||||
|
order_by: {line_no: asc}
|
||||||
|
where: {removed: {_eq: false}, mod_lb_hrs: {_lt: 3}}
|
||||||
|
) {
|
||||||
|
line_no
|
||||||
|
mod_lbr_ty
|
||||||
|
mod_lb_hrs
|
||||||
|
convertedtolbr
|
||||||
|
convertedtolbr_data
|
||||||
|
}
|
||||||
|
ownr_co_nm
|
||||||
|
ownr_fn
|
||||||
|
ownr_ln
|
||||||
|
plate_no
|
||||||
|
ro_number
|
||||||
|
status
|
||||||
|
v_make_desc
|
||||||
|
v_model_desc
|
||||||
|
v_model_yr
|
||||||
|
v_vin
|
||||||
|
v_color
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### Path with brackets,top level
|
||||||
|
|
||||||
|
`"name": "[jobs].joblines.mod_lb_hrs",`
|
||||||
|
This will produce a where clause at the `jobs` level of the graphQL query.
|
||||||
|
|
||||||
|
```graphql
|
||||||
|
query gendoc_hours_sold_detail_open($starttz: timestamptz!, $endtz: timestamptz!) {
|
||||||
|
jobs(
|
||||||
|
where: {date_invoiced: {_is_null: true}, date_open: {_gte: $starttz, _lte: $endtz}, ro_number: {_is_null: false}, voided: {_eq: false}, joblines: {mod_lb_hrs: {_gt: 4}}}
|
||||||
|
) {
|
||||||
|
joblines(
|
||||||
|
order_by: {line_no: asc}
|
||||||
|
where: {removed: {_eq: false}}
|
||||||
|
) {
|
||||||
|
line_no
|
||||||
|
mod_lbr_ty
|
||||||
|
mod_lb_hrs
|
||||||
|
convertedtolbr
|
||||||
|
convertedtolbr_data
|
||||||
|
}
|
||||||
|
ownr_co_nm
|
||||||
|
ownr_fn
|
||||||
|
ownr_ln
|
||||||
|
plate_no
|
||||||
|
ro_number
|
||||||
|
status
|
||||||
|
v_make_desc
|
||||||
|
v_model_desc
|
||||||
|
v_model_yr
|
||||||
|
v_vin
|
||||||
|
v_color
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Known Caveats
|
||||||
|
|
||||||
|
- Will only support two level of nesting in the graphQL query `jobs.joblines.mod_lb_hrs` vs `[jobs].joblines.mod_lb_hrs`
|
||||||
|
is fine, but `jobs.[joblines.].some_table.mod_lb_hrs` is not.
|
||||||
|
- The type object must be 'string' or 'number' or 'bool' or 'boolean' or 'date' and is case-sensitive.
|
||||||
|
- The `translation` key is used to look up the label in the GUI, if it is not found, the `label` key is used.
|
||||||
|
- Do not add the ability to filter things that are already filtered as part of the original query, this would be
|
||||||
|
redundant and could cause issues.
|
||||||
|
- Do not add the ability to filter on things like FK constraints, must like the above example.
|
||||||
|
|
||||||
|
## Sorters
|
||||||
|
|
||||||
|
- Sorters follow the same schema as filters, however, they do not do square bracket wrapping to indicate level hoisting,
|
||||||
|
a filter added on `job.md_status` would be added at the top level, and a filter added on `jobs.joblines.mod_lb_hrs`
|
||||||
|
would be added at the `joblines` level.
|
||||||
|
- Most of the reports currently do sorting on a template level, this will need to change to actually see the results
|
||||||
|
using the sorters.
|
||||||
|
|
||||||
|
### Default Sorters
|
||||||
|
|
||||||
|
- A sorter can be given a default object containing a `order` and `direction` key value. This will be used to sort the report if the user does not select any of the sorters themselves.
|
||||||
|
- The `order` key is the order in which the sorters are applied, and the `direction` key is the direction of the sort, either `asc` or `desc`.
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"name": "jobs.joblines.mod_lb_hrs",
|
||||||
|
"translation": "jobs.joblines.mod_lb_hrs_1",
|
||||||
|
"label": "mod_lb_hrs_1",
|
||||||
|
"type": "number",
|
||||||
|
"default": {
|
||||||
|
"order": 1,
|
||||||
|
"direction": "asc"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,14 @@
|
|||||||
REACT_APP_GRAPHQL_ENDPOINT=https://db.dev.bodyshop.app/v1/graphql
|
REACT_APP_GRAPHQL_ENDPOINT=https://db.dev.bodyshop.app/v1/graphql
|
||||||
REACT_APP_GRAPHQL_ENDPOINT_WS=wss://db.dev.bodyshop.app/v1/graphql
|
REACT_APP_GRAPHQL_ENDPOINT_WS=wss://db.dev.bodyshop.app/v1/graphql
|
||||||
REACT_APP_GA_CODE=231099835
|
REACT_APP_GA_CODE=231099835
|
||||||
REACT_APP_FIREBASE_CONFIG={"apiKey":"AIzaSyDPLT8GiDHDR1R4nI66Qi0BY1aYviDPioc","authDomain":"imex-dev.firebaseapp.com","databaseURL":"https://imex-dev.firebaseio.com","projectId":"imex-dev","storageBucket":"imex-dev.appspot.com","messagingSenderId":"759548147434","appId":"1:759548147434:web:e8239868a48ceb36700993","measurementId":"G-K5XRBVVB4S"}
|
REACT_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
|
||||||
REACT_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/io-test
|
REACT_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/io-test
|
||||||
REACT_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/io-test
|
REACT_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/io-test
|
||||||
REACT_APP_CLOUDINARY_API_KEY=957865933348715
|
REACT_APP_CLOUDINARY_API_KEY=957865933348715
|
||||||
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
||||||
REACT_APP_FIREBASE_PUBLIC_VAPID_KEY='BG3tzU7L2BXlGZ_3VLK4PNaRceoEXEnmHfxcVbRMF5o5g05ejslhVPki9kBM9cBBT-08Ad9kN3HSpS6JmrWD6h4'
|
REACT_APP_FIREBASE_PUBLIC_VAPID_KEY='BP1B7ZTYpn-KMt6nOxlld6aS8Skt3Q7ZLEqP0hAvGHxG4UojPYiXZ6kPlzZkUC5jH-EcWXomTLtmadAIxurfcHo'
|
||||||
REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
||||||
REACT_APP_AXIOS_BASE_API_URL=http://localhost:4000
|
REACT_APP_AXIOS_BASE_API_URL=http://localhost:4000
|
||||||
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
||||||
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
||||||
|
REACT_APP_COUNTRY=USA
|
||||||
@@ -1,14 +1,13 @@
|
|||||||
GENERATE_SOURCEMAP=false
|
REACT_APP_GRAPHQL_ENDPOINT=https://db.romeonline.io/v1/graphql
|
||||||
REACT_APP_GRAPHQL_ENDPOINT=https://db.imex.online/v1/graphql
|
REACT_APP_GRAPHQL_ENDPOINT_WS=wss://db.romeonline.io/v1/graphql
|
||||||
REACT_APP_GRAPHQL_ENDPOINT_WS=wss://db.imex.online/v1/graphql
|
|
||||||
REACT_APP_GA_CODE=231103507
|
REACT_APP_GA_CODE=231103507
|
||||||
REACT_APP_FIREBASE_CONFIG={"apiKey":"AIzaSyDSezy-jGJreo7ulgpLdlpOwAOrgcaEkhU","authDomain":"imex-prod.firebaseapp.com","databaseURL":"https://imex-prod.firebaseio.com","projectId":"imex-prod","storageBucket":"imex-prod.appspot.com","messagingSenderId":"253497221485","appId":"1:253497221485:web:3c81c483b94db84b227a64","measurementId":"G-NTWBKG2L0M"}
|
REACT_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
|
||||||
REACT_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/bodyshop
|
REACT_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/bodyshop
|
||||||
REACT_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/bodyshop
|
REACT_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/bodyshop
|
||||||
REACT_APP_CLOUDINARY_API_KEY=473322739956866
|
REACT_APP_CLOUDINARY_API_KEY=473322739956866
|
||||||
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
||||||
REACT_APP_FIREBASE_PUBLIC_VAPID_KEY='BMgZT1NZztW2DsJl8Mg2L04hgY9FzAg6b8fbzgNAfww2VDzH3VE63Ot9EaP_U7KWS2JT-7HPHaw0T_Tw_5vkZc8'
|
REACT_APP_FIREBASE_PUBLIC_VAPID_KEY='BP1B7ZTYpn-KMt6nOxlld6aS8Skt3Q7ZLEqP0hAvGHxG4UojPYiXZ6kPlzZkUC5jH-EcWXomTLtmadAIxurfcHo'
|
||||||
REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
||||||
REACT_APP_AXIOS_BASE_API_URL=https://api.imex.online/
|
REACT_APP_AXIOS_BASE_API_URL=https://api.romeonline.io/
|
||||||
REACT_APP_REPORTS_SERVER_URL=https://reports.imex.online
|
REACT_APP_REPORTS_SERVER_URL=https://reports.romeonline.io
|
||||||
REACT_APP_SPLIT_API=et9pjkik6bn67he5evpmpr1agoo7gactphgk
|
REACT_APP_SPLIT_API=et9pjkik6bn67he5evpmpr1agoo7gactphgk
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
REACT_APP_GRAPHQL_ENDPOINT=https://db.test.bodyshop.app/v1/graphql
|
REACT_APP_GRAPHQL_ENDPOINT=https://db.test.romeonline.io/v1/graphql
|
||||||
REACT_APP_GRAPHQL_ENDPOINT_WS=wss://db.test.bodyshop.app/v1/graphql
|
REACT_APP_GRAPHQL_ENDPOINT_WS=wss://db.test.romeonline.io/v1/graphql
|
||||||
REACT_APP_GA_CODE=231099835
|
REACT_APP_GA_CODE=231103507
|
||||||
REACT_APP_FIREBASE_CONFIG={ "apiKey":"AIzaSyBw7_GTy7GtQyfkIRPVrWHEGKfcqeyXw0c", "authDomain":"imex-test.firebaseapp.com", "projectId":"imex-test", "storageBucket":"imex-test.appspot.com", "messagingSenderId":"991923618608", "appId":"1:991923618608:web:633437569cdad78299bef5", "measurementId":"G-TW0XLZEH18"}
|
REACT_APP_FIREBASE_CONFIG={ "apiKey": "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE", "authDomain": "rome-prod-1.firebaseapp.com", "projectId": "rome-prod-1", "storageBucket": "rome-prod-1.appspot.com", "messagingSenderId": "147786367145", "appId": "1:147786367145:web:9d4cba68071c3f29a8a9b8", "measurementId": "G-G8Z9DRHTZS"}
|
||||||
REACT_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/bodyshop
|
REACT_APP_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/bodyshop
|
||||||
REACT_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/bodyshop
|
REACT_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/bodyshop
|
||||||
REACT_APP_CLOUDINARY_API_KEY=473322739956866
|
REACT_APP_CLOUDINARY_API_KEY=473322739956866
|
||||||
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
||||||
REACT_APP_FIREBASE_PUBLIC_VAPID_KEY='BN2GcDPjipR5MTEosO5dT4CfQ3cmrdBIsI4juoOQrRijn_5aRiHlwj1mlq0W145mOusx6xynEKl_tvYJhpCc9lo'
|
REACT_APP_FIREBASE_PUBLIC_VAPID_KEY='BP1B7ZTYpn-KMt6nOxlld6aS8Skt3Q7ZLEqP0hAvGHxG4UojPYiXZ6kPlzZkUC5jH-EcWXomTLtmadAIxurfcHo'
|
||||||
REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
||||||
REACT_APP_AXIOS_BASE_API_URL=https://api.test.imex.online/
|
REACT_APP_AXIOS_BASE_API_URL=https://api.test.romeonline.io/
|
||||||
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
REACT_APP_REPORTS_SERVER_URL=https://reports.test.romeonline.io
|
||||||
REACT_APP_IS_TEST=true
|
REACT_APP_IS_TEST=true
|
||||||
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
||||||
3
client/.gitignore
vendored
Normal file
3
client/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
|
||||||
|
# Sentry Config File
|
||||||
|
.sentryclirc
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
// craco.config.js
|
// craco.config.js
|
||||||
const TerserPlugin = require("terser-webpack-plugin");
|
const TerserPlugin = require("terser-webpack-plugin");
|
||||||
const CracoLessPlugin = require("craco-less");
|
const CracoLessPlugin = require("craco-less");
|
||||||
const SentryWebpackPlugin = require("@sentry/webpack-plugin");
|
//const SentryWebpackPlugin = require("@sentry/webpack-plugin");
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
plugins: [
|
plugins: [
|
||||||
{
|
// {
|
||||||
plugin: SentryWebpackPlugin,
|
// plugin: SentryWebpackPlugin,
|
||||||
options: {
|
// options: {
|
||||||
// sentry-cli configuration
|
// // sentry-cli configuration
|
||||||
authToken:
|
// authToken:
|
||||||
"6b45b028a02342db97a9a2f92c0959058665443d379d4a3a876430009e744260",
|
// "6b45b028a02342db97a9a2f92c0959058665443d379d4a3a876430009e744260",
|
||||||
org: "snapt-software",
|
// org: "snapt-software",
|
||||||
project: "imexonline",
|
// project: "imexonline",
|
||||||
release: process.env.REACT_APP_GIT_SHA,
|
// release: process.env.REACT_APP_GIT_SHA,
|
||||||
|
|
||||||
// webpack-specific configuration
|
// // webpack-specific configuration
|
||||||
include: ".",
|
// include: ".",
|
||||||
ignore: ["node_modules", "webpack.config.js"],
|
// ignore: ["node_modules", "webpack.config.js"],
|
||||||
},
|
// },
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
plugin: CracoLessPlugin,
|
plugin: CracoLessPlugin,
|
||||||
options: {
|
options: {
|
||||||
@@ -27,7 +27,7 @@ module.exports = {
|
|||||||
lessOptions: {
|
lessOptions: {
|
||||||
modifyVars: {
|
modifyVars: {
|
||||||
...(process.env.NODE_ENV === "development"
|
...(process.env.NODE_ENV === "development"
|
||||||
? { "@primary-color": "#a51d1d" }
|
? { "@primary-color": "#B22234" }
|
||||||
: {
|
: {
|
||||||
//"@primary-color": "#1DA57A"
|
//"@primary-color": "#1DA57A"
|
||||||
}),
|
}),
|
||||||
|
|||||||
649
client/package-lock.json
generated
649
client/package-lock.json
generated
@@ -13,12 +13,14 @@
|
|||||||
"@craco/craco": "^7.0.0",
|
"@craco/craco": "^7.0.0",
|
||||||
"@fingerprintjs/fingerprintjs": "^3.4.2",
|
"@fingerprintjs/fingerprintjs": "^3.4.2",
|
||||||
"@jsreport/browser-client": "^3.1.0",
|
"@jsreport/browser-client": "^3.1.0",
|
||||||
"@sentry/react": "^7.40.0",
|
"@sentry/cli": "^2.27.0",
|
||||||
|
"@sentry/react": "^7.99.0",
|
||||||
"@sentry/tracing": "^7.40.0",
|
"@sentry/tracing": "^7.40.0",
|
||||||
"@splitsoftware/splitio-react": "^1.8.1",
|
"@splitsoftware/splitio-react": "^1.8.1",
|
||||||
"@tanem/react-nprogress": "^5.0.8",
|
"@tanem/react-nprogress": "^5.0.8",
|
||||||
"antd": "^4.24.8",
|
"antd": "^4.24.8",
|
||||||
"apollo-link-logger": "^2.0.1",
|
"apollo-link-logger": "^2.0.1",
|
||||||
|
"apollo-link-sentry": "^3.3.0",
|
||||||
"axios": "^1.3.4",
|
"axios": "^1.3.4",
|
||||||
"craco-less": "^2.0.0",
|
"craco-less": "^2.0.0",
|
||||||
"dinero.js": "^1.9.1",
|
"dinero.js": "^1.9.1",
|
||||||
@@ -4214,40 +4216,195 @@
|
|||||||
"integrity": "sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==",
|
"integrity": "sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/@sentry/browser": {
|
"node_modules/@sentry-internal/feedback": {
|
||||||
"version": "7.40.0",
|
"version": "7.99.0",
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.40.0.tgz",
|
"resolved": "https://registry.npmjs.org/@sentry-internal/feedback/-/feedback-7.99.0.tgz",
|
||||||
"integrity": "sha512-07rZ+cTcpmYB1r84/oZtmSPJJvLCxW8yIh/5s4MdKRyZpqIDKhOz6cCS/4j+l1V+MeLcNLZBjFtNdKA2eocTpg==",
|
"integrity": "sha512-exIO1o+bE0MW4z30FxC0cYzJ4ZHSMlDPMHCBDPzU+MWGQc/fb8s58QUrx5Dnm6HTh9G3H+YlroCxIo9u0GSwGQ==",
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sentry/core": "7.40.0",
|
"@sentry/core": "7.99.0",
|
||||||
"@sentry/replay": "7.40.0",
|
"@sentry/types": "7.99.0",
|
||||||
"@sentry/types": "7.40.0",
|
"@sentry/utils": "7.99.0"
|
||||||
"@sentry/utils": "7.40.0",
|
},
|
||||||
"tslib": "^1.9.3"
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry-internal/feedback/node_modules/@sentry/core": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-vOAtzcAXEUtS/oW7wi3wMkZ3hsb5Ch96gKyrrj/mXdOp2zrcwdNV6N9/pawq2E9P/7Pw8AXw4CeDZztZrjQLuA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0",
|
||||||
|
"@sentry/utils": "7.99.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sentry/browser/node_modules/tslib": {
|
"node_modules/@sentry-internal/feedback/node_modules/@sentry/types": {
|
||||||
"version": "1.14.1",
|
"version": "7.99.0",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.99.0.tgz",
|
||||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
|
"integrity": "sha512-94qwOw4w40sAs5mCmzcGyj8ZUu/KhnWnuMZARRq96k+SjRW/tHFAOlIdnFSrt3BLPvSOK7R3bVAskZQ0N4FTmA==",
|
||||||
"license": "0BSD"
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry-internal/feedback/node_modules/@sentry/utils": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-cYZy5WNTkWs5GgggGnjfGqC44CWir0pAv4GVVSx0fsup4D4pMKBJPrtub15f9uC+QkUf3vVkqwpBqeFxtmJQTQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry-internal/replay-canvas": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry-internal/replay-canvas/-/replay-canvas-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-PoIkfusToDq0snfl2M6HJx/1KJYtXxYhQplrn11kYadO04SdG0XGXf4h7wBTMEQ7LDEAtQyvsOu4nEQtTO3YjQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/core": "7.99.0",
|
||||||
|
"@sentry/replay": "7.99.0",
|
||||||
|
"@sentry/types": "7.99.0",
|
||||||
|
"@sentry/utils": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry-internal/replay-canvas/node_modules/@sentry/core": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-vOAtzcAXEUtS/oW7wi3wMkZ3hsb5Ch96gKyrrj/mXdOp2zrcwdNV6N9/pawq2E9P/7Pw8AXw4CeDZztZrjQLuA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0",
|
||||||
|
"@sentry/utils": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry-internal/replay-canvas/node_modules/@sentry/types": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-94qwOw4w40sAs5mCmzcGyj8ZUu/KhnWnuMZARRq96k+SjRW/tHFAOlIdnFSrt3BLPvSOK7R3bVAskZQ0N4FTmA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry-internal/replay-canvas/node_modules/@sentry/utils": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-cYZy5WNTkWs5GgggGnjfGqC44CWir0pAv4GVVSx0fsup4D4pMKBJPrtub15f9uC+QkUf3vVkqwpBqeFxtmJQTQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry-internal/tracing": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-z3JQhHjoM1KdM20qrHwRClKJrNLr2CcKtCluq7xevLtXHJWNAQQbafnWD+Aoj85EWXBzKt9yJMv2ltcXJ+at+w==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/core": "7.99.0",
|
||||||
|
"@sentry/types": "7.99.0",
|
||||||
|
"@sentry/utils": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry-internal/tracing/node_modules/@sentry/core": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-vOAtzcAXEUtS/oW7wi3wMkZ3hsb5Ch96gKyrrj/mXdOp2zrcwdNV6N9/pawq2E9P/7Pw8AXw4CeDZztZrjQLuA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0",
|
||||||
|
"@sentry/utils": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry-internal/tracing/node_modules/@sentry/types": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-94qwOw4w40sAs5mCmzcGyj8ZUu/KhnWnuMZARRq96k+SjRW/tHFAOlIdnFSrt3BLPvSOK7R3bVAskZQ0N4FTmA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry-internal/tracing/node_modules/@sentry/utils": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-cYZy5WNTkWs5GgggGnjfGqC44CWir0pAv4GVVSx0fsup4D4pMKBJPrtub15f9uC+QkUf3vVkqwpBqeFxtmJQTQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/browser": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-bgfoUv3wkwwLgN5YUOe0ibB3y268ZCnamZh6nLFqnY/UBKC1+FXWFdvzVON/XKUm62LF8wlpCybOf08ebNj2yg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry-internal/feedback": "7.99.0",
|
||||||
|
"@sentry-internal/replay-canvas": "7.99.0",
|
||||||
|
"@sentry-internal/tracing": "7.99.0",
|
||||||
|
"@sentry/core": "7.99.0",
|
||||||
|
"@sentry/replay": "7.99.0",
|
||||||
|
"@sentry/types": "7.99.0",
|
||||||
|
"@sentry/utils": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/browser/node_modules/@sentry/core": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-vOAtzcAXEUtS/oW7wi3wMkZ3hsb5Ch96gKyrrj/mXdOp2zrcwdNV6N9/pawq2E9P/7Pw8AXw4CeDZztZrjQLuA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0",
|
||||||
|
"@sentry/utils": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/browser/node_modules/@sentry/types": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-94qwOw4w40sAs5mCmzcGyj8ZUu/KhnWnuMZARRq96k+SjRW/tHFAOlIdnFSrt3BLPvSOK7R3bVAskZQ0N4FTmA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/browser/node_modules/@sentry/utils": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-cYZy5WNTkWs5GgggGnjfGqC44CWir0pAv4GVVSx0fsup4D4pMKBJPrtub15f9uC+QkUf3vVkqwpBqeFxtmJQTQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sentry/cli": {
|
"node_modules/@sentry/cli": {
|
||||||
"version": "1.74.6",
|
"version": "2.27.0",
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-1.74.6.tgz",
|
"resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.27.0.tgz",
|
||||||
"integrity": "sha512-pJ7JJgozyjKZSTjOGi86chIngZMLUlYt2HOog+OJn+WGvqEkVymu8m462j1DiXAnex9NspB4zLLNuZ/R6rTQHg==",
|
"integrity": "sha512-pc0opd71W8lGhYvmB1keQtJkarxzCS9f9ErKYv6TfXOOX6drvwkyA6vD/6xEnpzyvqGAuGRU4T4sEeLD3irwUQ==",
|
||||||
"dev": true,
|
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "BSD-3-Clause",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"https-proxy-agent": "^5.0.0",
|
"https-proxy-agent": "^5.0.0",
|
||||||
"mkdirp": "^0.5.5",
|
|
||||||
"node-fetch": "^2.6.7",
|
"node-fetch": "^2.6.7",
|
||||||
"npmlog": "^4.1.2",
|
|
||||||
"progress": "^2.0.3",
|
"progress": "^2.0.3",
|
||||||
"proxy-from-env": "^1.1.0",
|
"proxy-from-env": "^1.1.0",
|
||||||
"which": "^2.0.2"
|
"which": "^2.0.2"
|
||||||
@@ -4256,7 +4413,124 @@
|
|||||||
"sentry-cli": "bin/sentry-cli"
|
"sentry-cli": "bin/sentry-cli"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 8"
|
"node": ">= 10"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@sentry/cli-darwin": "2.27.0",
|
||||||
|
"@sentry/cli-linux-arm": "2.27.0",
|
||||||
|
"@sentry/cli-linux-arm64": "2.27.0",
|
||||||
|
"@sentry/cli-linux-i686": "2.27.0",
|
||||||
|
"@sentry/cli-linux-x64": "2.27.0",
|
||||||
|
"@sentry/cli-win32-i686": "2.27.0",
|
||||||
|
"@sentry/cli-win32-x64": "2.27.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/cli-darwin": {
|
||||||
|
"version": "2.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/cli-darwin/-/cli-darwin-2.27.0.tgz",
|
||||||
|
"integrity": "sha512-/DOZlN5rK19g7YP2OaVNauQhUrRfJ88RDr6qURFiqdxYHDc3isPFGHZJmeZBTwOnDDepyZb4XLaOyfwvAOxHig==",
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/cli-linux-arm": {
|
||||||
|
"version": "2.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm/-/cli-linux-arm-2.27.0.tgz",
|
||||||
|
"integrity": "sha512-JmMQ9zgFhkZUEN5WIYuJisu4Jif/ThRHDjbsbXBRbUkkgRn88hgUfg299djMvlZZxjpl3K9AEua+1TIUeQd0Sg==",
|
||||||
|
"cpu": [
|
||||||
|
"arm"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux",
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/cli-linux-arm64": {
|
||||||
|
"version": "2.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-arm64/-/cli-linux-arm64-2.27.0.tgz",
|
||||||
|
"integrity": "sha512-f+zuB9XGfB8pNamNgSDhqsavuLuzi6saZxbr3uQf30bA5AESI5hspOd1zPcidOORCVZxiPzQe3+T7avBI1XLuw==",
|
||||||
|
"cpu": [
|
||||||
|
"arm64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux",
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/cli-linux-i686": {
|
||||||
|
"version": "2.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-i686/-/cli-linux-i686-2.27.0.tgz",
|
||||||
|
"integrity": "sha512-/4eyz7jnYp20mZqNtpvCEBkxFW0nEjEZRo2BiASQ5/7K8CmoJRe1vhpDA0WOfzi1zTFIfpdE1/RZm2CjHS6DHQ==",
|
||||||
|
"cpu": [
|
||||||
|
"x86",
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux",
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/cli-linux-x64": {
|
||||||
|
"version": "2.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/cli-linux-x64/-/cli-linux-x64-2.27.0.tgz",
|
||||||
|
"integrity": "sha512-ptu7wXecnYssihzHlxEOaqbFHWmNEfbepBKGXTdWK2kC+D51+7yHsR9xRdThwVID1bisFgjAveKmBQjmKuXjHQ==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"linux",
|
||||||
|
"freebsd"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/cli-win32-i686": {
|
||||||
|
"version": "2.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-i686/-/cli-win32-i686-2.27.0.tgz",
|
||||||
|
"integrity": "sha512-Db4/xmdE5qV4Aq7Yc8vRw22Y46JJdGMdsMsl5jIf0GVSQPgO23O/2uTiDGpPOdeq91K9EtvpH1zQfDLIfLMaXw==",
|
||||||
|
"cpu": [
|
||||||
|
"x86",
|
||||||
|
"ia32"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/cli-win32-x64": {
|
||||||
|
"version": "2.27.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/cli-win32-x64/-/cli-win32-x64-2.27.0.tgz",
|
||||||
|
"integrity": "sha512-q7y/BH4iGfs0TD5PXh2Q8oqnTbOIufoT1NWJcKqvZcOiqCLK3PNUiq7xUeX1PMTrFYAh3Bm6EekOnMavqvbGmg==",
|
||||||
|
"cpu": [
|
||||||
|
"x64"
|
||||||
|
],
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"win32"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sentry/core": {
|
"node_modules/@sentry/core": {
|
||||||
@@ -4280,16 +4554,15 @@
|
|||||||
"license": "0BSD"
|
"license": "0BSD"
|
||||||
},
|
},
|
||||||
"node_modules/@sentry/react": {
|
"node_modules/@sentry/react": {
|
||||||
"version": "7.40.0",
|
"version": "7.99.0",
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.40.0.tgz",
|
"resolved": "https://registry.npmjs.org/@sentry/react/-/react-7.99.0.tgz",
|
||||||
"integrity": "sha512-7yYagpOCdsXnVTtLL8Y7wAf2xXgsk2ncuju3O/G4kEckkLewZWmQeoknOSGFlAgVdGNhTaXc2WGzgOiBMOkhug==",
|
"integrity": "sha512-RtHwgzMHJhzJfSQpVG0SDPQYMTGDX3Q37/YWI59S4ALMbSW4/F6n/eQAvGVYZKbh2UCSqgFuRWaXOYkSZT17wA==",
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sentry/browser": "7.40.0",
|
"@sentry/browser": "7.99.0",
|
||||||
"@sentry/types": "7.40.0",
|
"@sentry/core": "7.99.0",
|
||||||
"@sentry/utils": "7.40.0",
|
"@sentry/types": "7.99.0",
|
||||||
"hoist-non-react-statics": "^3.3.2",
|
"@sentry/utils": "7.99.0",
|
||||||
"tslib": "^1.9.3"
|
"hoist-non-react-statics": "^3.3.2"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
@@ -4298,26 +4571,82 @@
|
|||||||
"react": "15.x || 16.x || 17.x || 18.x"
|
"react": "15.x || 16.x || 17.x || 18.x"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sentry/react/node_modules/tslib": {
|
"node_modules/@sentry/react/node_modules/@sentry/core": {
|
||||||
"version": "1.14.1",
|
"version": "7.99.0",
|
||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.99.0.tgz",
|
||||||
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==",
|
"integrity": "sha512-vOAtzcAXEUtS/oW7wi3wMkZ3hsb5Ch96gKyrrj/mXdOp2zrcwdNV6N9/pawq2E9P/7Pw8AXw4CeDZztZrjQLuA==",
|
||||||
"license": "0BSD"
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0",
|
||||||
|
"@sentry/utils": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/react/node_modules/@sentry/types": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-94qwOw4w40sAs5mCmzcGyj8ZUu/KhnWnuMZARRq96k+SjRW/tHFAOlIdnFSrt3BLPvSOK7R3bVAskZQ0N4FTmA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/react/node_modules/@sentry/utils": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-cYZy5WNTkWs5GgggGnjfGqC44CWir0pAv4GVVSx0fsup4D4pMKBJPrtub15f9uC+QkUf3vVkqwpBqeFxtmJQTQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sentry/replay": {
|
"node_modules/@sentry/replay": {
|
||||||
"version": "7.40.0",
|
"version": "7.99.0",
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.40.0.tgz",
|
"resolved": "https://registry.npmjs.org/@sentry/replay/-/replay-7.99.0.tgz",
|
||||||
"integrity": "sha512-Y9Kvo9jKouUdrHQhHVv5SmWZClF5o7BFI6oVpLlv4zXORPQlyoZONM/9sxiMvvH73alDSpxzCoxyhlypAOH4ww==",
|
"integrity": "sha512-gyN/I2WpQrLAZDT+rScB/0jnFL2knEVBo8U8/OVt8gNP20Pq8T/rDZKO/TG0cBfvULDUbJj2P4CJryn2p/O2rA==",
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sentry/core": "7.40.0",
|
"@sentry-internal/tracing": "7.99.0",
|
||||||
"@sentry/types": "7.40.0",
|
"@sentry/core": "7.99.0",
|
||||||
"@sentry/utils": "7.40.0"
|
"@sentry/types": "7.99.0",
|
||||||
|
"@sentry/utils": "7.99.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@sentry/replay/node_modules/@sentry/core": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/core/-/core-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-vOAtzcAXEUtS/oW7wi3wMkZ3hsb5Ch96gKyrrj/mXdOp2zrcwdNV6N9/pawq2E9P/7Pw8AXw4CeDZztZrjQLuA==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0",
|
||||||
|
"@sentry/utils": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/replay/node_modules/@sentry/types": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/types/-/types-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-94qwOw4w40sAs5mCmzcGyj8ZUu/KhnWnuMZARRq96k+SjRW/tHFAOlIdnFSrt3BLPvSOK7R3bVAskZQ0N4FTmA==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sentry/replay/node_modules/@sentry/utils": {
|
||||||
|
"version": "7.99.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-7.99.0.tgz",
|
||||||
|
"integrity": "sha512-cYZy5WNTkWs5GgggGnjfGqC44CWir0pAv4GVVSx0fsup4D4pMKBJPrtub15f9uC+QkUf3vVkqwpBqeFxtmJQTQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sentry/types": "7.99.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@sentry/tracing": {
|
"node_modules/@sentry/tracing": {
|
||||||
"version": "7.40.0",
|
"version": "7.40.0",
|
||||||
"resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.40.0.tgz",
|
"resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-7.40.0.tgz",
|
||||||
@@ -4381,6 +4710,27 @@
|
|||||||
"node": ">= 8"
|
"node": ">= 8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@sentry/webpack-plugin/node_modules/@sentry/cli": {
|
||||||
|
"version": "1.77.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-1.77.3.tgz",
|
||||||
|
"integrity": "sha512-c3eDqcDRmy4TFz2bFU5Y6QatlpoBPPa8cxBooaS4aMQpnIdLYPF1xhyyiW0LQlDUNc3rRjNF7oN5qKoaRoMTQQ==",
|
||||||
|
"dev": true,
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"dependencies": {
|
||||||
|
"https-proxy-agent": "^5.0.0",
|
||||||
|
"mkdirp": "^0.5.5",
|
||||||
|
"node-fetch": "^2.6.7",
|
||||||
|
"progress": "^2.0.3",
|
||||||
|
"proxy-from-env": "^1.1.0",
|
||||||
|
"which": "^2.0.2"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"sentry-cli": "bin/sentry-cli"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@sinclair/typebox": {
|
"node_modules/@sinclair/typebox": {
|
||||||
"version": "0.24.51",
|
"version": "0.24.51",
|
||||||
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz",
|
"resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.24.51.tgz",
|
||||||
@@ -6112,12 +6462,21 @@
|
|||||||
"@apollo/client": "^3.0.0"
|
"@apollo/client": "^3.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/aproba": {
|
"node_modules/apollo-link-sentry": {
|
||||||
"version": "1.2.0",
|
"version": "3.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/apollo-link-sentry/-/apollo-link-sentry-3.3.0.tgz",
|
||||||
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
|
"integrity": "sha512-wLffWmo5sRw3rHN1Ck6azM0oxObvtaBBf3AC8cLX4SxhyjmkRIagGDji6CFkyAhxupPz0b9/H1u4Ocx+63lNug==",
|
||||||
"dev": true,
|
"dependencies": {
|
||||||
"license": "ISC"
|
"deepmerge": "^4.2.2",
|
||||||
|
"dot-prop": "^6.0.0",
|
||||||
|
"tslib": "^2.0.3",
|
||||||
|
"zen-observable-ts": "^1.2.5"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@apollo/client": "^3.2.3",
|
||||||
|
"@sentry/browser": "^7.41.0",
|
||||||
|
"graphql": "15 - 16"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/arch": {
|
"node_modules/arch": {
|
||||||
"version": "2.2.0",
|
"version": "2.2.0",
|
||||||
@@ -6140,17 +6499,6 @@
|
|||||||
],
|
],
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/are-we-there-yet": {
|
|
||||||
"version": "1.1.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz",
|
|
||||||
"integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"delegates": "^1.0.0",
|
|
||||||
"readable-stream": "^2.0.6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/arg": {
|
"node_modules/arg": {
|
||||||
"version": "5.0.2",
|
"version": "5.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/arg/-/arg-5.0.2.tgz",
|
||||||
@@ -7571,16 +7919,6 @@
|
|||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/code-point-at": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-RpAVKQA5T63xEj6/giIbUEtZwJ4UFIc3ZtvEkiaUERylqe8xb5IvqcgOurZLahv93CLKfxcw5YI+DZcUBRyLXA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/collect-v8-coverage": {
|
"node_modules/collect-v8-coverage": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz",
|
||||||
@@ -7743,13 +8081,6 @@
|
|||||||
"node": ">=0.8"
|
"node": ">=0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/console-control-strings": {
|
|
||||||
"version": "1.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz",
|
|
||||||
"integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/content-disposition": {
|
"node_modules/content-disposition": {
|
||||||
"version": "0.5.4",
|
"version": "0.5.4",
|
||||||
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
|
"resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz",
|
||||||
@@ -8911,13 +9242,6 @@
|
|||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/delegates": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/denque": {
|
"node_modules/denque": {
|
||||||
"version": "1.5.1",
|
"version": "1.5.1",
|
||||||
"resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/denque/-/denque-1.5.1.tgz",
|
||||||
@@ -9218,6 +9542,28 @@
|
|||||||
"tslib": "^2.0.3"
|
"tslib": "^2.0.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/dot-prop": {
|
||||||
|
"version": "6.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
|
||||||
|
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
|
||||||
|
"dependencies": {
|
||||||
|
"is-obj": "^2.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/dot-prop/node_modules/is-obj": {
|
||||||
|
"version": "2.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
|
||||||
|
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=8"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/dotenv": {
|
"node_modules/dotenv": {
|
||||||
"version": "16.0.1",
|
"version": "16.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz",
|
||||||
@@ -10464,6 +10810,8 @@
|
|||||||
},
|
},
|
||||||
"node_modules/eventemitter2": {
|
"node_modules/eventemitter2": {
|
||||||
"version": "6.4.7",
|
"version": "6.4.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz",
|
||||||
|
"integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
@@ -11283,74 +11631,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/gauge": {
|
|
||||||
"version": "2.7.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz",
|
|
||||||
"integrity": "sha512-14x4kjc6lkD3ltw589k0NrPD6cCNTD6CWoVUNpB85+DrtONoZn+Rug6xZU5RvSC4+TZPxA5AnBibQYAvZn41Hg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"aproba": "^1.0.3",
|
|
||||||
"console-control-strings": "^1.0.0",
|
|
||||||
"has-unicode": "^2.0.0",
|
|
||||||
"object-assign": "^4.1.0",
|
|
||||||
"signal-exit": "^3.0.0",
|
|
||||||
"string-width": "^1.0.1",
|
|
||||||
"strip-ansi": "^3.0.1",
|
|
||||||
"wide-align": "^1.1.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/gauge/node_modules/ansi-regex": {
|
|
||||||
"version": "2.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz",
|
|
||||||
"integrity": "sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/gauge/node_modules/is-fullwidth-code-point": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-1pqUqRjkhPJ9miNq9SwMfdvi6lBJcd6eFxvfaivQhaH3SgisfiuudvFntdKOmxuee/77l+FPjKrQjWvmPjWrRw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"number-is-nan": "^1.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/gauge/node_modules/string-width": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-0XsVpQLnVCXHJfyEs8tC0zpTVIr5PKKsQtkT29IwupnPTjtPmQ3xT/4yCREF9hYkV/3M3kzcUTSAZT6a6h81tw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"code-point-at": "^1.0.0",
|
|
||||||
"is-fullwidth-code-point": "^1.0.0",
|
|
||||||
"strip-ansi": "^3.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/gauge/node_modules/strip-ansi": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"ansi-regex": "^2.0.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/gensync": {
|
"node_modules/gensync": {
|
||||||
"version": "1.0.0-beta.2",
|
"version": "1.0.0-beta.2",
|
||||||
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
|
"resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz",
|
||||||
@@ -11753,13 +12033,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/has-unicode": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/he": {
|
"node_modules/he": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz",
|
||||||
@@ -15744,19 +16017,6 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/npmlog": {
|
|
||||||
"version": "4.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz",
|
|
||||||
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"are-we-there-yet": "~1.1.2",
|
|
||||||
"console-control-strings": "~1.1.0",
|
|
||||||
"gauge": "~2.7.3",
|
|
||||||
"set-blocking": "~2.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/nth-check": {
|
"node_modules/nth-check": {
|
||||||
"version": "2.1.1",
|
"version": "2.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
|
||||||
@@ -15769,16 +16029,6 @@
|
|||||||
"url": "https://github.com/fb55/nth-check?sponsor=1"
|
"url": "https://github.com/fb55/nth-check?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/number-is-nan": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-4jbtZXNAsfZbAHiiqjLPBiCl16dES1zI4Hpzzxw61Tk+loF+sBDBKx1ICKKKwIqQ7M0mFn1TmkN7euSncWgHiQ==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/nwsapi": {
|
"node_modules/nwsapi": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.1.tgz",
|
||||||
@@ -17794,7 +18044,6 @@
|
|||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz",
|
||||||
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
|
"integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==",
|
||||||
"dev": true,
|
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.4.0"
|
"node": ">=0.4.0"
|
||||||
@@ -20526,13 +20775,6 @@
|
|||||||
"node": ">= 0.8.0"
|
"node": ">= 0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/set-blocking": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC"
|
|
||||||
},
|
|
||||||
"node_modules/setprototypeof": {
|
"node_modules/setprototypeof": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz",
|
||||||
@@ -22110,19 +22352,6 @@
|
|||||||
"is-typedarray": "^1.0.0"
|
"is-typedarray": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/typescript": {
|
|
||||||
"version": "4.9.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz",
|
|
||||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
|
||||||
"peer": true,
|
|
||||||
"bin": {
|
|
||||||
"tsc": "bin/tsc",
|
|
||||||
"tsserver": "bin/tsserver"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=4.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/typescript-compare": {
|
"node_modules/typescript-compare": {
|
||||||
"version": "0.0.2",
|
"version": "0.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/typescript-compare/-/typescript-compare-0.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript-compare/-/typescript-compare-0.0.2.tgz",
|
||||||
@@ -23080,16 +23309,6 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/wide-align": {
|
|
||||||
"version": "1.1.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz",
|
|
||||||
"integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==",
|
|
||||||
"dev": true,
|
|
||||||
"license": "ISC",
|
|
||||||
"dependencies": {
|
|
||||||
"string-width": "^1.0.2 || 2 || 3 || 4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/wildcard": {
|
"node_modules/wildcard": {
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/wildcard/-/wildcard-2.0.0.tgz",
|
||||||
|
|||||||
@@ -9,12 +9,14 @@
|
|||||||
"@craco/craco": "^7.0.0",
|
"@craco/craco": "^7.0.0",
|
||||||
"@fingerprintjs/fingerprintjs": "^3.4.2",
|
"@fingerprintjs/fingerprintjs": "^3.4.2",
|
||||||
"@jsreport/browser-client": "^3.1.0",
|
"@jsreport/browser-client": "^3.1.0",
|
||||||
"@sentry/react": "^7.40.0",
|
"@sentry/cli": "^2.27.0",
|
||||||
|
"@sentry/react": "^7.99.0",
|
||||||
"@sentry/tracing": "^7.40.0",
|
"@sentry/tracing": "^7.40.0",
|
||||||
"@splitsoftware/splitio-react": "^1.8.1",
|
"@splitsoftware/splitio-react": "^1.8.1",
|
||||||
"@tanem/react-nprogress": "^5.0.8",
|
"@tanem/react-nprogress": "^5.0.8",
|
||||||
"antd": "^4.24.8",
|
"antd": "^4.24.8",
|
||||||
"apollo-link-logger": "^2.0.1",
|
"apollo-link-logger": "^2.0.1",
|
||||||
|
"apollo-link-sentry": "^3.3.0",
|
||||||
"axios": "^1.3.4",
|
"axios": "^1.3.4",
|
||||||
"craco-less": "^2.0.0",
|
"craco-less": "^2.0.0",
|
||||||
"dinero.js": "^1.9.1",
|
"dinero.js": "^1.9.1",
|
||||||
@@ -88,13 +90,14 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
"analyze": "source-map-explorer 'build/static/js/*.js'",
|
||||||
"start": "craco start",
|
"start": "craco start",
|
||||||
"build": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build",
|
"build": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build && npm run sentry:sourcemaps",
|
||||||
"build:test": "env-cmd -f .env.test npm run build",
|
"build:test": "env-cmd -f .env.test npm run build",
|
||||||
"build-deploy:test": "npm run build:test && s3cmd sync build/* s3://imex-online-test && echo '🚀 TESTING Deployed!'",
|
"build-deploy:test": "npm run build:test && s3cmd sync build/* s3://imex-online-test && echo '🚀 TESTING Deployed!'",
|
||||||
"buildcra": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build",
|
"buildcra": "REACT_APP_GIT_SHA=`git rev-parse --short HEAD` craco build",
|
||||||
"test": "cypress open",
|
"test": "cypress open",
|
||||||
"eject": "react-scripts eject",
|
"eject": "react-scripts eject",
|
||||||
"madge": "madge --image ./madge-graph.svg --extensions js,jsx,ts,tsx --circular ."
|
"madge": "madge --image ./madge-graph.svg --extensions js,jsx,ts,tsx --circular .",
|
||||||
|
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org imex --project imexonline ./build && sentry-cli sourcemaps upload --org imex --project imexonline ./build"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"extends": [
|
"extends": [
|
||||||
|
|||||||
@@ -28,6 +28,17 @@ switch (this.location.hostname) {
|
|||||||
// measurementId: "${config.measurementId}",
|
// measurementId: "${config.measurementId}",
|
||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
|
case "romeonline.io":
|
||||||
|
firebaseConfig = {
|
||||||
|
apiKey: "AIzaSyAuLQR9SV5LsVxjU8wh9hvFLdhcAHU6cxE",
|
||||||
|
authDomain: "rome-prod-1.firebaseapp.com",
|
||||||
|
projectId: "rome-prod-1",
|
||||||
|
storageBucket: "rome-prod-1.appspot.com",
|
||||||
|
messagingSenderId: "147786367145",
|
||||||
|
appId: "1:147786367145:web:9d4cba68071c3f29a8a9b8",
|
||||||
|
measurementId: "G-G8Z9DRHTZS",
|
||||||
|
};
|
||||||
|
break;
|
||||||
case "imex.online":
|
case "imex.online":
|
||||||
default:
|
default:
|
||||||
firebaseConfig = {
|
firebaseConfig = {
|
||||||
|
|||||||
@@ -2,23 +2,81 @@
|
|||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<link rel="icon" href="%PUBLIC_URL%/favicon.png" />
|
<link rel="icon" href="%PUBLIC_URL%/ro-favicon.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||||
<meta name="theme-color" content="#002366" />
|
<meta name="theme-color" content="#002366" />
|
||||||
<meta name="description" content="ImEX Online" />
|
<meta name="description" content="Rome Online" />
|
||||||
<!-- <link rel="apple-touch-icon" href="logo192.png" /> -->
|
<!-- <link rel="apple-touch-icon" href="logo192.png" /> -->
|
||||||
|
|
||||||
|
<!--Use the below code snippet to provide real time updates to the live chat plugin without the need of copying and paste each time to your website when changes are made via PBX-->
|
||||||
|
|
||||||
|
<call-us-selector phonesystem-url=https://rometech.east.3cx.us:5001 party="LiveChat528346"></call-us-selector>
|
||||||
|
|
||||||
|
<!--Incase you don't want real time updates to the live chat plugin when options are changed, use the below code snippet. Please note that each time you change the settings you will need to copy and paste the snippet code to your website-->
|
||||||
|
|
||||||
|
<!--<call-us
|
||||||
|
|
||||||
|
phonesystem-url=https://rometech.east.3cx.us:5001
|
||||||
|
|
||||||
|
style="position:fixed;font-size:16px;line-height:17px;z-index: 99999;right: 20px; bottom: 20px;"
|
||||||
|
|
||||||
|
id="wp-live-chat-by-3CX"
|
||||||
|
|
||||||
|
minimized="true"
|
||||||
|
|
||||||
|
animation-style="noanimation"
|
||||||
|
|
||||||
|
party="LiveChat528346"
|
||||||
|
|
||||||
|
minimized-style="bubbleright"
|
||||||
|
|
||||||
|
allow-call="true"
|
||||||
|
|
||||||
|
allow-video="false"
|
||||||
|
|
||||||
|
allow-soundnotifications="true"
|
||||||
|
|
||||||
|
enable-mute="true"
|
||||||
|
|
||||||
|
enable-onmobile="true"
|
||||||
|
|
||||||
|
offline-enabled="true"
|
||||||
|
|
||||||
|
enable="true"
|
||||||
|
|
||||||
|
ignore-queueownership="false"
|
||||||
|
|
||||||
|
authentication="both"
|
||||||
|
|
||||||
|
show-operator-actual-name="true"
|
||||||
|
|
||||||
|
aknowledge-received="true"
|
||||||
|
|
||||||
|
gdpr-enabled="false"
|
||||||
|
|
||||||
|
message-userinfo-format="name"
|
||||||
|
|
||||||
|
message-dateformat="both"
|
||||||
|
|
||||||
|
lang="browser"
|
||||||
|
|
||||||
|
button-icon-type="default"
|
||||||
|
|
||||||
|
greeting-visibility="none"
|
||||||
|
|
||||||
|
greeting-offline-visibility="none"
|
||||||
|
|
||||||
|
chat-delay="2000"
|
||||||
|
|
||||||
|
enable-direct-call="true"
|
||||||
|
|
||||||
|
enable-ga="false"
|
||||||
|
|
||||||
|
></call-us>-->
|
||||||
|
|
||||||
|
<script defer src=https://downloads-global.3cx.com/downloads/livechatandtalk/v1/callus.js id="tcx-callus-js" charset="utf-8"></script>
|
||||||
|
|
||||||
<link rel="apple-touch-icon" href="logo192.png" />
|
<link rel="apple-touch-icon" href="logo192.png" />
|
||||||
<script type="text/javascript">
|
|
||||||
window.$crisp = [];
|
|
||||||
window.CRISP_WEBSITE_ID = "36724f62-2eb0-4b29-9cdd-9905fb99913e";
|
|
||||||
(function () {
|
|
||||||
d = document;
|
|
||||||
s = d.createElement("script");
|
|
||||||
s.src = "https://client.crisp.chat/l.js";
|
|
||||||
s.async = 1;
|
|
||||||
d.getElementsByTagName("head")[0].appendChild(s);
|
|
||||||
})();
|
|
||||||
</script>
|
|
||||||
<script>
|
<script>
|
||||||
!(function () {
|
!(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
@@ -77,7 +135,7 @@
|
|||||||
work correctly both with client-side routing and a non-root public URL.
|
work correctly both with client-side routing and a non-root public URL.
|
||||||
Learn how to configure a non-root public URL by running `npm run build`.
|
Learn how to configure a non-root public URL by running `npm run build`.
|
||||||
-->
|
-->
|
||||||
<title>ImEX Online</title>
|
<title>Rome Online</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"short_name": "ImEX Online",
|
"short_name": "Rome Online",
|
||||||
"name": "ImEX Online",
|
"name": "Rome Online",
|
||||||
"description": "The ultimate bodyshop management system.",
|
"description": "The ultimate bodyshop management system.",
|
||||||
"icons": [
|
"icons": [
|
||||||
{
|
{
|
||||||
|
|||||||
BIN
client/public/ro-favicon.png
Normal file
BIN
client/public/ro-favicon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 376 B |
@@ -8,6 +8,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import GlobalLoadingBar from "../components/global-loading-bar/global-loading-bar.component";
|
import GlobalLoadingBar from "../components/global-loading-bar/global-loading-bar.component";
|
||||||
import client from "../utils/GraphQLClient";
|
import client from "../utils/GraphQLClient";
|
||||||
import App from "./App";
|
import App from "./App";
|
||||||
|
import * as Sentry from "@sentry/react";
|
||||||
|
|
||||||
moment.locale("en-US");
|
moment.locale("en-US");
|
||||||
|
|
||||||
@@ -18,7 +19,7 @@ export const factory = SplitSdk({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
export default function AppContainer() {
|
function AppContainer() {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -27,6 +28,12 @@ export default function AppContainer() {
|
|||||||
//componentSize="small"
|
//componentSize="small"
|
||||||
input={{ autoComplete: "new-password" }}
|
input={{ autoComplete: "new-password" }}
|
||||||
locale={enLocale}
|
locale={enLocale}
|
||||||
|
theme={{
|
||||||
|
token: {
|
||||||
|
colorPrimary: "#326ade",
|
||||||
|
colorInfo: "#326ade"
|
||||||
|
},
|
||||||
|
}}
|
||||||
form={{
|
form={{
|
||||||
validateMessages: {
|
validateMessages: {
|
||||||
// eslint-disable-next-line no-template-curly-in-string
|
// eslint-disable-next-line no-template-curly-in-string
|
||||||
@@ -42,3 +49,5 @@ export default function AppContainer() {
|
|||||||
</ApolloProvider>
|
</ApolloProvider>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default Sentry.withProfiler(AppContainer);
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ import {
|
|||||||
} from "../redux/user/user.selectors";
|
} 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 handleBeta from "../utils/handleBeta";
|
||||||
|
|
||||||
const ResetPassword = lazy(() =>
|
const ResetPassword = lazy(() =>
|
||||||
import("../pages/reset-password/reset-password.component")
|
import("../pages/reset-password/reset-password.component")
|
||||||
@@ -57,7 +58,6 @@ export function App({
|
|||||||
if (!navigator.onLine) {
|
if (!navigator.onLine) {
|
||||||
setOnline(false);
|
setOnline(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
checkUserSession();
|
checkUserSession();
|
||||||
}, [checkUserSession, setOnline]);
|
}, [checkUserSession, setOnline]);
|
||||||
|
|
||||||
@@ -73,13 +73,14 @@ export function App({
|
|||||||
window.addEventListener("online", function (e) {
|
window.addEventListener("online", function (e) {
|
||||||
setOnline(true);
|
setOnline(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (currentUser.authorized && bodyshop) {
|
if (currentUser.authorized && bodyshop) {
|
||||||
client.setAttribute("imexshopid", bodyshop.imexshopid);
|
client.setAttribute("imexshopid", bodyshop.imexshopid);
|
||||||
|
|
||||||
|
LogRocket.init("rome-online/rome-online");
|
||||||
if (client.getTreatment("LogRocket_Tracking") === "on") {
|
if (client.getTreatment("LogRocket_Tracking") === "on") {
|
||||||
console.log("LR Start");
|
LogRocket.init("rome-online/rome-online");
|
||||||
LogRocket.init("gvfvfw/bodyshopapp");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, [bodyshop, client, currentUser.authorized]);
|
}, [bodyshop, client, currentUser.authorized]);
|
||||||
@@ -107,9 +108,11 @@ export function App({
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
handleBeta();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Switch>
|
<Switch>
|
||||||
<Suspense fallback={<LoadingSpinner message="ImEX Online" />}>
|
<Suspense fallback={<LoadingSpinner />}>
|
||||||
<ErrorBoundary>
|
<ErrorBoundary>
|
||||||
<Route exact path="/" component={LandingPage} />
|
<Route exact path="/" component={LandingPage} />
|
||||||
</ErrorBoundary>
|
</ErrorBoundary>
|
||||||
|
|||||||
BIN
client/src/assets/RomeOnline.png
Normal file
BIN
client/src/assets/RomeOnline.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 26 KiB |
BIN
client/src/assets/RomeOnlineBlue.png
Normal file
BIN
client/src/assets/RomeOnlineBlue.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 27 KiB |
BIN
client/src/assets/romelogo.png
Normal file
BIN
client/src/assets/romelogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
@@ -3,10 +3,22 @@ import { useMutation } from "@apollo/client";
|
|||||||
import { Button, notification, Popconfirm } from "antd";
|
import { Button, notification, Popconfirm } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
import { DELETE_BILL } from "../../graphql/bills.queries";
|
import { DELETE_BILL } from "../../graphql/bills.queries";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
import RbacWrapper from "../rbac-wrapper/rbac-wrapper.component";
|
||||||
|
|
||||||
export default function BillDeleteButton({ bill, callback }) {
|
const mapStateToProps = createStructuredSelector({});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(BillDeleteButton);
|
||||||
|
|
||||||
|
export function BillDeleteButton({ bill, jobid, callback, insertAuditTrail }) {
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [deleteBill] = useMutation(DELETE_BILL);
|
const [deleteBill] = useMutation(DELETE_BILL);
|
||||||
@@ -36,6 +48,10 @@ export default function BillDeleteButton({ bill, callback }) {
|
|||||||
|
|
||||||
if (!!!result.errors) {
|
if (!!!result.errors) {
|
||||||
notification["success"]({ message: t("bills.successes.deleted") });
|
notification["success"]({ message: t("bills.successes.deleted") });
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: jobid,
|
||||||
|
operation: AuditTrailMapping.billdeleted(bill.invoice_number),
|
||||||
|
});
|
||||||
|
|
||||||
if (callback && typeof callback === "function") callback(bill.id);
|
if (callback && typeof callback === "function") callback(bill.id);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { useApolloClient, useMutation } from "@apollo/client";
|
import { useApolloClient, useMutation } from "@apollo/client";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Button, Checkbox, Form, Modal, Space, notification } from "antd";
|
import { Button, Checkbox, Form, Modal, Space, notification } from "antd";
|
||||||
import _ from "lodash";
|
import _ from "lodash";
|
||||||
import React, { useEffect, useMemo, useState } from "react";
|
import React, { useEffect, useMemo, useState } from "react";
|
||||||
@@ -63,9 +64,19 @@ function BillEnterModalContainer({
|
|||||||
"enter_bill_generate_label",
|
"enter_bill_generate_label",
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
const { Enhanced_Payroll } = useTreatments(
|
||||||
|
["Enhanced_Payroll"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
const formValues = useMemo(() => {
|
const formValues = useMemo(() => {
|
||||||
return {
|
return {
|
||||||
...billEnterModal.context.bill,
|
...billEnterModal.context.bill,
|
||||||
|
//Added as a part of IO-2436 for capturing parts price changes.
|
||||||
|
billlines: billEnterModal.context?.bill?.billlines?.map((line) => ({
|
||||||
|
...line,
|
||||||
|
original_actual_price: line.actual_price,
|
||||||
|
})),
|
||||||
jobid:
|
jobid:
|
||||||
(billEnterModal.context.job && billEnterModal.context.job.id) || null,
|
(billEnterModal.context.job && billEnterModal.context.job.id) || null,
|
||||||
federal_tax_rate:
|
federal_tax_rate:
|
||||||
@@ -94,10 +105,12 @@ function BillEnterModalContainer({
|
|||||||
location,
|
location,
|
||||||
outstanding_returns,
|
outstanding_returns,
|
||||||
inventory,
|
inventory,
|
||||||
|
federal_tax_exempt,
|
||||||
...remainingValues
|
...remainingValues
|
||||||
} = values;
|
} = values;
|
||||||
|
|
||||||
let adjustmentsToInsert = {};
|
let adjustmentsToInsert = {};
|
||||||
|
let payrollAdjustmentsToInsert = [];
|
||||||
|
|
||||||
const r1 = await insertBill({
|
const r1 = await insertBill({
|
||||||
variables: {
|
variables: {
|
||||||
@@ -113,14 +126,33 @@ function BillEnterModalContainer({
|
|||||||
lbr_adjustment,
|
lbr_adjustment,
|
||||||
location: lineLocation,
|
location: lineLocation,
|
||||||
part_type,
|
part_type,
|
||||||
|
create_ppc,
|
||||||
|
original_actual_price,
|
||||||
...restI
|
...restI
|
||||||
} = i;
|
} = i;
|
||||||
|
|
||||||
if (deductedfromlbr) {
|
if (Enhanced_Payroll.treatment === "on") {
|
||||||
adjustmentsToInsert[lbr_adjustment.mod_lbr_ty] =
|
if (
|
||||||
(adjustmentsToInsert[lbr_adjustment.mod_lbr_ty] || 0) -
|
deductedfromlbr &&
|
||||||
restI.actual_price / lbr_adjustment.rate;
|
true //payroll is on
|
||||||
|
) {
|
||||||
|
payrollAdjustmentsToInsert.push({
|
||||||
|
id: i.joblineid,
|
||||||
|
convertedtolbr: true,
|
||||||
|
convertedtolbr_data: {
|
||||||
|
mod_lb_hrs: lbr_adjustment.mod_lb_hrs * -1,
|
||||||
|
mod_lbr_ty: lbr_adjustment.mod_lbr_ty,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (deductedfromlbr) {
|
||||||
|
adjustmentsToInsert[lbr_adjustment.mod_lbr_ty] =
|
||||||
|
(adjustmentsToInsert[lbr_adjustment.mod_lbr_ty] || 0) -
|
||||||
|
restI.actual_price / lbr_adjustment.rate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
...restI,
|
...restI,
|
||||||
deductedfromlbr: deductedfromlbr,
|
deductedfromlbr: deductedfromlbr,
|
||||||
@@ -146,6 +178,20 @@ function BillEnterModalContainer({
|
|||||||
refetchQueries: ["QUERY_PARTS_BILLS_BY_JOBID", "GET_JOB_BY_PK"],
|
refetchQueries: ["QUERY_PARTS_BILLS_BY_JOBID", "GET_JOB_BY_PK"],
|
||||||
});
|
});
|
||||||
|
|
||||||
|
await Promise.all(
|
||||||
|
payrollAdjustmentsToInsert.map((li) => {
|
||||||
|
return updateJobLines({
|
||||||
|
variables: {
|
||||||
|
lineId: li.id,
|
||||||
|
line: {
|
||||||
|
convertedtolbr: li.convertedtolbr,
|
||||||
|
convertedtolbr_data: li.convertedtolbr_data,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
const adjKeys = Object.keys(adjustmentsToInsert);
|
const adjKeys = Object.keys(adjustmentsToInsert);
|
||||||
if (adjKeys.length > 0) {
|
if (adjKeys.length > 0) {
|
||||||
//Query the adjustments, merge, and update them.
|
//Query the adjustments, merge, and update them.
|
||||||
@@ -254,6 +300,14 @@ function BillEnterModalContainer({
|
|||||||
location: li.location || location,
|
location: li.location || location,
|
||||||
status:
|
status:
|
||||||
bodyshop.md_order_statuses.default_received || "Received*",
|
bodyshop.md_order_statuses.default_received || "Received*",
|
||||||
|
//Added parts price changes.
|
||||||
|
...(li.create_ppc &&
|
||||||
|
li.original_actual_price !== li.actual_price
|
||||||
|
? {
|
||||||
|
act_price_before_ppc: li.original_actual_price,
|
||||||
|
act_price: li.actual_price,
|
||||||
|
}
|
||||||
|
: {}),
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -322,12 +376,12 @@ function BillEnterModalContainer({
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (enterAgain) {
|
if (enterAgain) {
|
||||||
form.resetFields();
|
// form.resetFields();
|
||||||
form.resetFields();
|
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
...formValues,
|
...formValues,
|
||||||
billlines: [],
|
billlines: [],
|
||||||
});
|
});
|
||||||
|
form.resetFields();
|
||||||
} else {
|
} else {
|
||||||
toggleModalVisible();
|
toggleModalVisible();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,19 +79,19 @@ export function BillFormComponent({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleFederalTaxExemptSwitchToggle = (checked) => {
|
// const handleFederalTaxExemptSwitchToggle = (checked) => {
|
||||||
// Early gate
|
// // Early gate
|
||||||
if (!checked) return;
|
// if (!checked) return;
|
||||||
const values = form.getFieldsValue("billlines");
|
// const values = form.getFieldsValue("billlines");
|
||||||
// Gate bill lines
|
// // Gate bill lines
|
||||||
if (!values?.billlines?.length) return;
|
// if (!values?.billlines?.length) return;
|
||||||
|
|
||||||
const billlines = values.billlines.map((b) => {
|
// const billlines = values.billlines.map((b) => {
|
||||||
b.applicable_taxes.federal = false;
|
// b.applicable_taxes.federal = false;
|
||||||
return b;
|
// return b;
|
||||||
});
|
// });
|
||||||
form.setFieldsValue({ billlines });
|
// form.setFieldsValue({ billlines });
|
||||||
};
|
// };
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (job) form.validateFields(["is_credit_memo"]);
|
if (job) form.validateFields(["is_credit_memo"]);
|
||||||
@@ -380,13 +380,15 @@ export function BillFormComponent({
|
|||||||
)}
|
)}
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow>
|
<LayoutFormRow>
|
||||||
<Form.Item
|
{
|
||||||
span={3}
|
// <Form.Item
|
||||||
label={t("bills.fields.federal_tax_rate")}
|
// span={3}
|
||||||
name="federal_tax_rate"
|
// label={t("bills.fields.federal_tax_rate")}
|
||||||
>
|
// name="federal_tax_rate"
|
||||||
<CurrencyInput min={0} disabled={disabled} />
|
// >
|
||||||
</Form.Item>
|
// <CurrencyInput min={0} disabled={disabled} />
|
||||||
|
// </Form.Item>
|
||||||
|
}
|
||||||
<Form.Item
|
<Form.Item
|
||||||
span={3}
|
span={3}
|
||||||
label={t("bills.fields.state_tax_rate")}
|
label={t("bills.fields.state_tax_rate")}
|
||||||
@@ -394,22 +396,27 @@ export function BillFormComponent({
|
|||||||
>
|
>
|
||||||
<CurrencyInput min={0} disabled={disabled} />
|
<CurrencyInput min={0} disabled={disabled} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
{
|
||||||
span={3}
|
// <Form.Item
|
||||||
label={t("bills.fields.local_tax_rate")}
|
// span={3}
|
||||||
name="local_tax_rate"
|
// label={t("bills.fields.local_tax_rate")}
|
||||||
>
|
// name="local_tax_rate"
|
||||||
<CurrencyInput min={0} />
|
// >
|
||||||
</Form.Item>
|
// <CurrencyInput min={0} />
|
||||||
{bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid ? (
|
// </Form.Item>
|
||||||
<Form.Item
|
}
|
||||||
span={2}
|
{
|
||||||
label={t("bills.labels.federal_tax_exempt")}
|
//Removed as a part of the merge to Rome Online. Federal tax not applicable.
|
||||||
name="federal_tax_exempt"
|
// bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid ? (
|
||||||
>
|
// <Form.Item
|
||||||
<Switch onChange={handleFederalTaxExemptSwitchToggle} />
|
// span={2}
|
||||||
</Form.Item>
|
// label={t("bills.labels.federal_tax_exempt")}
|
||||||
) : null}
|
// name="federal_tax_exempt"
|
||||||
|
// >
|
||||||
|
// <Switch onChange={handleFederalTaxExemptSwitchToggle} />
|
||||||
|
// </Form.Item>
|
||||||
|
// ) : null
|
||||||
|
}
|
||||||
<Form.Item shouldUpdate span={13}>
|
<Form.Item shouldUpdate span={13}>
|
||||||
{() => {
|
{() => {
|
||||||
const values = form.getFieldsValue([
|
const values = form.getFieldsValue([
|
||||||
@@ -435,21 +442,25 @@ export function BillFormComponent({
|
|||||||
value={totals.subtotal.toFormat()}
|
value={totals.subtotal.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
/>
|
/>
|
||||||
<Statistic
|
{
|
||||||
title={t("bills.labels.federal_tax")}
|
// <Statistic
|
||||||
value={totals.federalTax.toFormat()}
|
// title={t("bills.labels.federal_tax")}
|
||||||
precision={2}
|
// value={totals.federalTax.toFormat()}
|
||||||
/>
|
// precision={2}
|
||||||
|
// />
|
||||||
|
}
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("bills.labels.state_tax")}
|
title={t("bills.labels.state_tax")}
|
||||||
value={totals.stateTax.toFormat()}
|
value={totals.stateTax.toFormat()}
|
||||||
precision={2}
|
precision={2}
|
||||||
/>
|
/>
|
||||||
<Statistic
|
{
|
||||||
title={t("bills.labels.local_tax")}
|
// <Statistic
|
||||||
value={totals.localTax.toFormat()}
|
// title={t("bills.labels.local_tax")}
|
||||||
precision={2}
|
// value={totals.localTax.toFormat()}
|
||||||
/>
|
// precision={2}
|
||||||
|
// />
|
||||||
|
}
|
||||||
<Statistic
|
<Statistic
|
||||||
title={t("bills.labels.entered_total")}
|
title={t("bills.labels.entered_total")}
|
||||||
value={totals.enteredTotal.toFormat()}
|
value={totals.enteredTotal.toFormat()}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { DeleteFilled, DollarCircleFilled } from "@ant-design/icons";
|
|||||||
import { useTreatments } from "@splitsoftware/splitio-react";
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
|
Checkbox,
|
||||||
Form,
|
Form,
|
||||||
Input,
|
Input,
|
||||||
InputNumber,
|
InputNumber,
|
||||||
@@ -46,6 +47,13 @@ export function BillEnterModalLinesComponent({
|
|||||||
{},
|
{},
|
||||||
bodyshop && bodyshop.imexshopid
|
bodyshop && bodyshop.imexshopid
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const { Enhanced_Payroll } = useTreatments(
|
||||||
|
["Enhanced_Payroll"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
|
|
||||||
const columns = (remove) => {
|
const columns = (remove) => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
@@ -94,6 +102,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
line_desc: opt.line_desc,
|
line_desc: opt.line_desc,
|
||||||
quantity: opt.part_qty || 1,
|
quantity: opt.part_qty || 1,
|
||||||
actual_price: opt.cost,
|
actual_price: opt.cost,
|
||||||
|
original_actual_price: opt.cost,
|
||||||
cost_center: opt.part_type
|
cost_center: opt.part_type
|
||||||
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
? bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid
|
||||||
? opt.part_type !== "PAE"
|
? opt.part_type !== "PAE"
|
||||||
@@ -220,6 +229,43 @@ export function BillEnterModalLinesComponent({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
|
additional: (record, index) => (
|
||||||
|
<Form.Item
|
||||||
|
dependencies={["billlines", record.name, "actual_price"]}
|
||||||
|
noStyle
|
||||||
|
>
|
||||||
|
{() => {
|
||||||
|
const billLine = getFieldValue(["billlines", record.name]);
|
||||||
|
const jobLine = lineData.find(
|
||||||
|
(line) => line.id === billLine?.joblineid
|
||||||
|
);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!billEdit &&
|
||||||
|
billLine &&
|
||||||
|
jobLine &&
|
||||||
|
billLine?.actual_price !== jobLine?.act_price
|
||||||
|
) {
|
||||||
|
return (
|
||||||
|
<Space size="small">
|
||||||
|
<Form.Item
|
||||||
|
noStyle
|
||||||
|
label={t("joblines.fields.create_ppc")}
|
||||||
|
key={`${index}ppc`}
|
||||||
|
valuePropName="checked"
|
||||||
|
name={[record.name, "create_ppc"]}
|
||||||
|
>
|
||||||
|
<Checkbox />
|
||||||
|
</Form.Item>
|
||||||
|
{t("joblines.fields.create_ppc")}
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
</Form.Item>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("billlines.fields.actual_cost"),
|
title: t("billlines.fields.actual_cost"),
|
||||||
@@ -361,7 +407,7 @@ export function BillEnterModalLinesComponent({
|
|||||||
},
|
},
|
||||||
formInput: (record, index) => <Switch disabled={disabled} />,
|
formInput: (record, index) => <Switch disabled={disabled} />,
|
||||||
additional: (record, index) => (
|
additional: (record, index) => (
|
||||||
<Form.Item shouldUpdate style={{ display: "inline-block" }}>
|
<Form.Item shouldUpdate noStyle style={{ display: "inline-block" }}>
|
||||||
{() => {
|
{() => {
|
||||||
const price = getFieldValue([
|
const price = getFieldValue([
|
||||||
"billlines",
|
"billlines",
|
||||||
@@ -376,12 +422,31 @@ export function BillEnterModalLinesComponent({
|
|||||||
"rate",
|
"rate",
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
const billline = getFieldValue(["billlines", record.name]);
|
||||||
|
|
||||||
|
const jobline = lineData.find(
|
||||||
|
(line) => line.id === billline?.joblineid
|
||||||
|
);
|
||||||
|
|
||||||
|
const employeeTeamName = bodyshop.employee_teams.find(
|
||||||
|
(team) => team.id === jobline?.assigned_team
|
||||||
|
);
|
||||||
|
|
||||||
if (getFieldValue(["billlines", record.name, "deductedfromlbr"]))
|
if (getFieldValue(["billlines", record.name, "deductedfromlbr"]))
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
|
<Space>
|
||||||
|
{t("joblines.fields.assigned_team", {
|
||||||
|
name: employeeTeamName?.name,
|
||||||
|
})}
|
||||||
|
{`${jobline.mod_lb_hrs} units/${t(
|
||||||
|
`joblines.fields.lbr_types.${jobline.mod_lbr_ty}`
|
||||||
|
)}`}
|
||||||
|
</Space>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("joblines.fields.mod_lbr_ty")}
|
label={t("joblines.fields.mod_lbr_ty")}
|
||||||
key={`${index}modlbrty`}
|
key={`${index}modlbrty`}
|
||||||
|
initialValue={jobline ? jobline.mod_lbr_ty : null}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
@@ -435,22 +500,44 @@ export function BillEnterModalLinesComponent({
|
|||||||
</Select.Option>
|
</Select.Option>
|
||||||
</Select>
|
</Select>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
{Enhanced_Payroll.treatment === "on" ? (
|
||||||
label={t("jobs.labels.adjustmentrate")}
|
<Form.Item
|
||||||
name={[record.name, "lbr_adjustment", "rate"]}
|
label={t("billlines.labels.mod_lbr_adjustment")}
|
||||||
initialValue={bodyshop.default_adjustment_rate}
|
name={[record.name, "lbr_adjustment", "mod_lb_hrs"]}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
//message: t("general.validation.required"),
|
//message: t("general.validation.required"),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber precision={2} min={0.01} />
|
<InputNumber
|
||||||
</Form.Item>
|
precision={5}
|
||||||
{price &&
|
min={0.01}
|
||||||
adjustmentRate &&
|
max={jobline ? jobline.mod_lb_hrs : 0}
|
||||||
`${(price / adjustmentRate).toFixed(1)} hrs`}
|
/>
|
||||||
|
</Form.Item>
|
||||||
|
) : (
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.labels.adjustmentrate")}
|
||||||
|
name={[record.name, "lbr_adjustment", "rate"]}
|
||||||
|
initialValue={bodyshop.default_adjustment_rate}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<InputNumber precision={2} min={0.01} />
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
|
|
||||||
|
<Space>
|
||||||
|
{price &&
|
||||||
|
adjustmentRate &&
|
||||||
|
`${(price / adjustmentRate).toFixed(1)} hrs`}
|
||||||
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
return <></>;
|
return <></>;
|
||||||
@@ -458,22 +545,21 @@ export function BillEnterModalLinesComponent({
|
|||||||
</Form.Item>
|
</Form.Item>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: t("billlines.fields.federal_tax_applicable"),
|
// title: t("billlines.fields.federal_tax_applicable"),
|
||||||
dataIndex: "applicable_taxes.federal",
|
// dataIndex: "applicable_taxes.federal",
|
||||||
editable: true,
|
// editable: true,
|
||||||
|
|
||||||
formItemProps: (field) => {
|
// formItemProps: (field) => {
|
||||||
return {
|
// return {
|
||||||
key: `${field.index}fedtax`,
|
// key: `${field.index}fedtax`,
|
||||||
valuePropName: "checked",
|
// valuePropName: "checked",
|
||||||
initialValue:
|
// // initialValue: true,
|
||||||
form.getFieldValue("federal_tax_exempt") === true ? false : true,
|
// name: [field.name, "applicable_taxes", "federal"],
|
||||||
name: [field.name, "applicable_taxes", "federal"],
|
// };
|
||||||
};
|
// },
|
||||||
},
|
// formInput: (record, index) => <Switch disabled={disabled} />,
|
||||||
formInput: (record, index) => <Switch disabled={disabled} />,
|
// },
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: t("billlines.fields.state_tax_applicable"),
|
title: t("billlines.fields.state_tax_applicable"),
|
||||||
dataIndex: "applicable_taxes.state",
|
dataIndex: "applicable_taxes.state",
|
||||||
@@ -488,20 +574,20 @@ export function BillEnterModalLinesComponent({
|
|||||||
},
|
},
|
||||||
formInput: (record, index) => <Switch disabled={disabled} />,
|
formInput: (record, index) => <Switch disabled={disabled} />,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: t("billlines.fields.local_tax_applicable"),
|
// title: t("billlines.fields.local_tax_applicable"),
|
||||||
dataIndex: "applicable_taxes.local",
|
// dataIndex: "applicable_taxes.local",
|
||||||
editable: true,
|
// editable: true,
|
||||||
|
|
||||||
formItemProps: (field) => {
|
// formItemProps: (field) => {
|
||||||
return {
|
// return {
|
||||||
key: `${field.index}localtax`,
|
// key: `${field.index}localtax`,
|
||||||
valuePropName: "checked",
|
// valuePropName: "checked",
|
||||||
name: [field.name, "applicable_taxes", "local"],
|
// name: [field.name, "applicable_taxes", "local"],
|
||||||
};
|
// };
|
||||||
},
|
// },
|
||||||
formInput: (record, index) => <Switch disabled={disabled} />,
|
// formInput: (record, index) => <Switch disabled={disabled} />,
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
title: t("general.labels.actions"),
|
title: t("general.labels.actions"),
|
||||||
|
|
||||||
@@ -626,7 +712,7 @@ const EditableCell = ({
|
|||||||
if (additional)
|
if (additional)
|
||||||
return (
|
return (
|
||||||
<td {...restProps}>
|
<td {...restProps}>
|
||||||
<Space size="small">
|
<div size="small">
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name={dataIndex}
|
name={dataIndex}
|
||||||
labelCol={{ span: 0 }}
|
labelCol={{ span: 0 }}
|
||||||
@@ -635,7 +721,7 @@ const EditableCell = ({
|
|||||||
{(formInput && formInput(record, record.name)) || children}
|
{(formInput && formInput(record, record.name)) || children}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{additional && additional(record, record.name)}
|
{additional && additional(record, record.name)}
|
||||||
</Space>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
);
|
);
|
||||||
if (wrapper)
|
if (wrapper)
|
||||||
|
|||||||
@@ -19,14 +19,14 @@ export const CalculateBillTotal = (invoice) => {
|
|||||||
}).multiply(i.quantity || 1);
|
}).multiply(i.quantity || 1);
|
||||||
|
|
||||||
subtotal = subtotal.add(itemTotal);
|
subtotal = subtotal.add(itemTotal);
|
||||||
if (i.applicable_taxes.federal) {
|
if (i.applicable_taxes?.federal) {
|
||||||
federalTax = federalTax.add(
|
federalTax = federalTax.add(
|
||||||
itemTotal.percentage(federal_tax_rate || 0)
|
itemTotal.percentage(federal_tax_rate || 0)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (i.applicable_taxes.state)
|
if (i.applicable_taxes?.state)
|
||||||
stateTax = stateTax.add(itemTotal.percentage(state_tax_rate || 0));
|
stateTax = stateTax.add(itemTotal.percentage(state_tax_rate || 0));
|
||||||
if (i.applicable_taxes.local)
|
if (i.applicable_taxes?.local)
|
||||||
localTax = localTax.add(itemTotal.percentage(local_tax_rate || 0));
|
localTax = localTax.add(itemTotal.percentage(local_tax_rate || 0));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -63,6 +63,12 @@ const BillLineSearchSelect = (
|
|||||||
item.oem_partno ? ` - ${item.oem_partno}` : ""
|
item.oem_partno ? ` - ${item.oem_partno}` : ""
|
||||||
}${item.alt_partno ? ` (${item.alt_partno})` : ""}`.trim()}
|
}${item.alt_partno ? ` (${item.alt_partno})` : ""}`.trim()}
|
||||||
</span>
|
</span>
|
||||||
|
{item.act_price === 0 && item.mod_lb_hrs > 0 && (
|
||||||
|
<span style={{ float: "right", paddingleft: "1rem" }}>
|
||||||
|
{`${item.mod_lb_hrs} units`}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
|
||||||
<span style={{ float: "right", paddingleft: "1rem" }}>
|
<span style={{ float: "right", paddingleft: "1rem" }}>
|
||||||
{item.act_price
|
{item.act_price
|
||||||
? `$${item.act_price && item.act_price.toFixed(2)}`
|
? `$${item.act_price && item.act_price.toFixed(2)}`
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ import { setModalContext } from "../../redux/modals/modals.actions";
|
|||||||
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 { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
import { alphaSort, dateSort } from "../../utils/sorters";
|
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
|
import { alphaSort, dateSort } from "../../utils/sorters";
|
||||||
import BillDeleteButton from "../bill-delete-button/bill-delete-button.component";
|
import BillDeleteButton from "../bill-delete-button/bill-delete-button.component";
|
||||||
import BillDetailEditReturnComponent from "../bill-detail-edit/bill-detail-edit-return.component";
|
import BillDetailEditReturnComponent from "../bill-detail-edit/bill-detail-edit-return.component";
|
||||||
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
||||||
@@ -58,7 +58,7 @@ export function BillsListTableComponent({
|
|||||||
<EditFilled />
|
<EditFilled />
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
<BillDeleteButton bill={record} />
|
<BillDeleteButton bill={record} jobid={job.id} />
|
||||||
<BillDetailEditReturnComponent
|
<BillDetailEditReturnComponent
|
||||||
data={{ bills_by_pk: { ...record, jobid: job.id } }}
|
data={{ bills_by_pk: { ...record, jobid: job.id } }}
|
||||||
disabled={
|
disabled={
|
||||||
|
|||||||
@@ -68,6 +68,30 @@ export default function ContractFormComponent({
|
|||||||
<FormDateTimePicker />
|
<FormDateTimePicker />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
{create && (
|
||||||
|
<Form.Item
|
||||||
|
shouldUpdate={(p, c) => p.scheduledreturn !== c.scheduledreturn}
|
||||||
|
>
|
||||||
|
{() => {
|
||||||
|
const insuranceOver =
|
||||||
|
selectedCar &&
|
||||||
|
selectedCar.insuranceexpires &&
|
||||||
|
moment(selectedCar.insuranceexpires)
|
||||||
|
.endOf("day")
|
||||||
|
.isBefore(moment(form.getFieldValue("scheduledreturn")));
|
||||||
|
if (insuranceOver)
|
||||||
|
return (
|
||||||
|
<Space direction="vertical" style={{ color: "tomato" }}>
|
||||||
|
<span>
|
||||||
|
<WarningFilled style={{ marginRight: ".3rem" }} />
|
||||||
|
{t("contracts.labels.insuranceexpired")}
|
||||||
|
</span>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
return <></>;
|
||||||
|
}}
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow grow>
|
<LayoutFormRow grow>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
@@ -90,16 +114,17 @@ export default function ContractFormComponent({
|
|||||||
>
|
>
|
||||||
{() => {
|
{() => {
|
||||||
const mileageOver =
|
const mileageOver =
|
||||||
selectedCar &&
|
selectedCar && selectedCar.nextservicekm
|
||||||
selectedCar.nextservicekm <= form.getFieldValue("kmstart");
|
? selectedCar.nextservicekm <= form.getFieldValue("kmstart")
|
||||||
|
: false;
|
||||||
const dueForService =
|
const dueForService =
|
||||||
selectedCar &&
|
selectedCar &&
|
||||||
selectedCar.nextservicedate &&
|
selectedCar.nextservicedate &&
|
||||||
moment(selectedCar.nextservicedate).isBefore(
|
moment(selectedCar.nextservicedate)
|
||||||
moment(form.getFieldValue("scheduledreturn"))
|
.endOf("day")
|
||||||
);
|
.isSameOrBefore(
|
||||||
|
moment(form.getFieldValue("scheduledreturn"))
|
||||||
|
);
|
||||||
if (mileageOver || dueForService)
|
if (mileageOver || dueForService)
|
||||||
return (
|
return (
|
||||||
<Space direction="vertical" style={{ color: "tomato" }}>
|
<Space direction="vertical" style={{ color: "tomato" }}>
|
||||||
@@ -117,7 +142,6 @@ export default function ContractFormComponent({
|
|||||||
</span>
|
</span>
|
||||||
</Space>
|
</Space>
|
||||||
);
|
);
|
||||||
|
|
||||||
return <></>;
|
return <></>;
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -214,10 +214,7 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
>
|
>
|
||||||
<CourtesyCarStatus />
|
<CourtesyCarStatus />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item label={t("courtesycars.fields.readiness")} name="readiness">
|
||||||
label={t("courtesycars.fields.readiness")}
|
|
||||||
name="readiness"
|
|
||||||
>
|
|
||||||
<CourtesyCarReadiness />
|
<CourtesyCarReadiness />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<div>
|
<div>
|
||||||
@@ -234,8 +231,9 @@ export default function CourtesyCarCreateFormComponent({ form, saveLoading }) {
|
|||||||
>
|
>
|
||||||
{() => {
|
{() => {
|
||||||
const nextservicekm = form.getFieldValue("nextservicekm");
|
const nextservicekm = form.getFieldValue("nextservicekm");
|
||||||
const mileageOver =
|
const mileageOver = nextservicekm
|
||||||
nextservicekm && nextservicekm <= form.getFieldValue("mileage");
|
? nextservicekm <= form.getFieldValue("mileage")
|
||||||
|
: false;
|
||||||
if (mileageOver)
|
if (mileageOver)
|
||||||
return (
|
return (
|
||||||
<Space direction="vertical" style={{ color: "tomato" }}>
|
<Space direction="vertical" style={{ color: "tomato" }}>
|
||||||
|
|||||||
@@ -17,13 +17,18 @@ import { DateTimeFormatter } from "../../utils/DateFormatter";
|
|||||||
import { GenerateDocument } from "../../utils/RenderTemplate";
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
import { TemplateList } from "../../utils/TemplateConstants";
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
|
import useLocalStorage from "../../utils/useLocalStorage";
|
||||||
import { OwnerNameDisplayFunction } from "../owner-name-display/owner-name-display.component";
|
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: {},
|
||||||
filteredInfo: { text: "" },
|
|
||||||
});
|
});
|
||||||
const [searchText, setSearchText] = useState("");
|
const [searchText, setSearchText] = useState("");
|
||||||
|
const [filter, setFilter] = useLocalStorage(
|
||||||
|
"filter_courtesy_cars_list",
|
||||||
|
null
|
||||||
|
);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
@@ -50,6 +55,7 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
|||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
key: "status",
|
key: "status",
|
||||||
sorter: (a, b) => alphaSort(a.status, b.status),
|
sorter: (a, b) => alphaSort(a.status, b.status),
|
||||||
|
filteredValue: filter?.status || null,
|
||||||
filters: [
|
filters: [
|
||||||
{
|
{
|
||||||
text: t("courtesycars.status.in"),
|
text: t("courtesycars.status.in"),
|
||||||
@@ -72,18 +78,34 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
|||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
const { nextservicedate, nextservicekm, mileage } = record;
|
const { nextservicedate, nextservicekm, mileage, insuranceexpires } =
|
||||||
|
record;
|
||||||
|
|
||||||
const mileageOver = nextservicekm <= mileage;
|
const mileageOver = nextservicekm ? nextservicekm <= mileage : false;
|
||||||
|
|
||||||
const dueForService =
|
const dueForService =
|
||||||
nextservicedate && moment(nextservicedate).isBefore(moment());
|
nextservicedate &&
|
||||||
|
moment(nextservicedate).endOf("day").isSameOrBefore(moment());
|
||||||
|
|
||||||
|
const insuranceOver =
|
||||||
|
insuranceexpires &&
|
||||||
|
moment(insuranceexpires).endOf("day").isBefore(moment());
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Space>
|
<Space>
|
||||||
{t(record.status)}
|
{t(record.status)}
|
||||||
{(mileageOver || dueForService) && (
|
{(mileageOver || dueForService || insuranceOver) && (
|
||||||
<Tooltip title={t("contracts.labels.cardueforservice")}>
|
<Tooltip
|
||||||
|
title={
|
||||||
|
(mileageOver || dueForService) && insuranceOver
|
||||||
|
? t("contracts.labels.insuranceexpired") +
|
||||||
|
" / " +
|
||||||
|
t("contracts.labels.cardueforservice")
|
||||||
|
: insuranceOver
|
||||||
|
? t("contracts.labels.insuranceexpired")
|
||||||
|
: t("contracts.labels.cardueforservice")
|
||||||
|
}
|
||||||
|
>
|
||||||
<WarningFilled style={{ color: "tomato" }} />
|
<WarningFilled style={{ color: "tomato" }} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
)}
|
)}
|
||||||
@@ -96,6 +118,7 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
|||||||
dataIndex: "readiness",
|
dataIndex: "readiness",
|
||||||
key: "readiness",
|
key: "readiness",
|
||||||
sorter: (a, b) => alphaSort(a.readiness, b.readiness),
|
sorter: (a, b) => alphaSort(a.readiness, b.readiness),
|
||||||
|
filteredValue: filter?.readiness || null,
|
||||||
filters: [
|
filters: [
|
||||||
{
|
{
|
||||||
text: t("courtesycars.readiness.ready"),
|
text: t("courtesycars.readiness.ready"),
|
||||||
@@ -211,7 +234,8 @@ export default function CourtesyCarsList({ loading, courtesycars, refetch }) {
|
|||||||
];
|
];
|
||||||
|
|
||||||
const handleTableChange = (pagination, filters, sorter) => {
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
setState({ ...state, sortedInfo: sorter });
|
||||||
|
setFilter(filters);
|
||||||
};
|
};
|
||||||
|
|
||||||
const tableData = searchText
|
const tableData = searchText
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import React, { useEffect } from "react";
|
|||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { useLocation } from "react-router-dom";
|
import { useLocation } from "react-router-dom";
|
||||||
import { QUERY_CSI_RESPONSE_BY_PK } from "../../graphql/csi.queries";
|
import { QUERY_CSI_RESPONSE_BY_PK } from "../../graphql/csi.queries";
|
||||||
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import ConfigFormComponents from "../config-form-components/config-form-components.component";
|
import ConfigFormComponents from "../config-form-components/config-form-components.component";
|
||||||
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
@@ -44,6 +45,13 @@ export default function CsiResponseFormContainer() {
|
|||||||
readOnly
|
readOnly
|
||||||
componentList={data.csi_by_pk.csiquestion.config}
|
componentList={data.csi_by_pk.csiquestion.config}
|
||||||
/>
|
/>
|
||||||
|
{data.csi_by_pk.validuntil ? (
|
||||||
|
<>
|
||||||
|
{t("csi.fields.validuntil")}
|
||||||
|
{": "}
|
||||||
|
<DateFormatter>{data.csi_by_pk.validuntil}</DateFormatter>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
</Form>
|
</Form>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -5,9 +5,11 @@ 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 { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { pageLimit } from "../../utils/config";
|
||||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
import { alphaSort, dateSort } from "../../utils/sorters";
|
||||||
import {pageLimit} from "../../utils/config";
|
import OwnerNameDisplay, {
|
||||||
|
OwnerNameDisplayFunction,
|
||||||
|
} from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
export default function CsiResponseListPaginated({
|
export default function CsiResponseListPaginated({
|
||||||
refetch,
|
refetch,
|
||||||
@@ -16,23 +18,23 @@ export default function CsiResponseListPaginated({
|
|||||||
total,
|
total,
|
||||||
}) {
|
}) {
|
||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
const { responseid, page, sortcolumn, sortorder } = search;
|
const { responseid } = search;
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
const { t } = useTranslation();
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
sortedInfo: {},
|
sortedInfo: {},
|
||||||
filteredInfo: { text: "" },
|
filteredInfo: { text: "" },
|
||||||
|
page: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
const { t } = useTranslation();
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
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: (a, b) => alphaSort(a.job.ro_number, b.job.ro_number),
|
sorter: (a, b) => alphaSort(a.job.ro_number, b.job.ro_number),
|
||||||
sortOrder: sortcolumn === "ro_number" && sortorder,
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Link to={"/manage/jobs/" + record.job.id}>
|
<Link to={"/manage/jobs/" + record.job.id}>
|
||||||
{record.job.ro_number || t("general.labels.na")}
|
{record.job.ro_number || t("general.labels.na")}
|
||||||
@@ -41,15 +43,18 @@ export default function CsiResponseListPaginated({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.owner"),
|
title: t("jobs.fields.owner"),
|
||||||
dataIndex: "owner",
|
dataIndex: "owner_name",
|
||||||
key: "owner",
|
key: "owner_name",
|
||||||
ellipsis: true,
|
sorter: (a, b) =>
|
||||||
sorter: (a, b) => alphaSort(a.job.ownr_ln, b.job.ownr_ln),
|
alphaSort(
|
||||||
width: "25%",
|
OwnerNameDisplayFunction(a.job),
|
||||||
sortOrder: sortcolumn === "owner" && sortorder,
|
OwnerNameDisplayFunction(b.job)
|
||||||
|
),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "owner_name" && state.sortedInfo.order,
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.job.owner ? (
|
return record.job.ownerid ? (
|
||||||
<Link to={"/manage/owners/" + record.job.owner.id}>
|
<Link to={"/manage/owners/" + record.job.ownerid}>
|
||||||
<OwnerNameDisplay ownerObject={record.job} />
|
<OwnerNameDisplay ownerObject={record.job} />
|
||||||
</Link>
|
</Link>
|
||||||
) : (
|
) : (
|
||||||
@@ -64,9 +69,9 @@ export default function CsiResponseListPaginated({
|
|||||||
dataIndex: "completedon",
|
dataIndex: "completedon",
|
||||||
key: "completedon",
|
key: "completedon",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
sorter: (a, b) => a.completedon - b.completedon,
|
sorter: (a, b) => dateSort(a.completedon, b.completedon),
|
||||||
width: "25%",
|
sortOrder:
|
||||||
sortOrder: sortcolumn === "completedon" && sortorder,
|
state.sortedInfo.columnKey === "completedon" && state.sortedInfo.order,
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.completedon ? (
|
return record.completedon ? (
|
||||||
<DateFormatter>{record.completedon}</DateFormatter>
|
<DateFormatter>{record.completedon}</DateFormatter>
|
||||||
@@ -76,11 +81,12 @@ export default function CsiResponseListPaginated({
|
|||||||
];
|
];
|
||||||
|
|
||||||
const handleTableChange = (pagination, filters, sorter) => {
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
setState({
|
||||||
search.page = pagination.current;
|
...state,
|
||||||
search.sortcolumn = sorter.columnKey;
|
filteredInfo: filters,
|
||||||
search.sortorder = sorter.order;
|
sortedInfo: sorter,
|
||||||
history.push({ search: queryString.stringify(search) });
|
page: pagination.current,
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOnRowClick = (record) => {
|
const handleOnRowClick = (record) => {
|
||||||
@@ -108,7 +114,7 @@ export default function CsiResponseListPaginated({
|
|||||||
pagination={{
|
pagination={{
|
||||||
position: "top",
|
position: "top",
|
||||||
pageSize: pageLimit,
|
pageSize: pageLimit,
|
||||||
current: parseInt(page || 1),
|
current: parseInt(state.page || 1),
|
||||||
total: total,
|
total: total,
|
||||||
}}
|
}}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
@@ -122,13 +128,6 @@ export default function CsiResponseListPaginated({
|
|||||||
selectedRowKeys: [responseid],
|
selectedRowKeys: [responseid],
|
||||||
type: "radio",
|
type: "radio",
|
||||||
}}
|
}}
|
||||||
onRow={(record, rowIndex) => {
|
|
||||||
return {
|
|
||||||
onClick: (event) => {
|
|
||||||
handleOnRowClick(record);
|
|
||||||
}, // click row
|
|
||||||
};
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,21 +3,32 @@ import {
|
|||||||
ExclamationCircleFilled,
|
ExclamationCircleFilled,
|
||||||
PauseCircleOutlined,
|
PauseCircleOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { Card, Space, Table, Tooltip } from "antd";
|
import { Card, Space, Switch, Table, Tooltip, Typography } 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 { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
import { TimeFormatter } from "../../../utils/DateFormatter";
|
||||||
|
import { onlyUnique } from "../../../utils/arrayHelper";
|
||||||
|
import { alphaSort, dateSort } from "../../../utils/sorters";
|
||||||
|
import useLocalStorage from "../../../utils/useLocalStorage";
|
||||||
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";
|
import OwnerNameDisplay, {
|
||||||
|
OwnerNameDisplayFunction,
|
||||||
|
} from "../../owner-name-display/owner-name-display.component";
|
||||||
import DashboardRefreshRequired from "../refresh-required.component";
|
import DashboardRefreshRequired from "../refresh-required.component";
|
||||||
import {pageLimit} from "../../../utils/config";
|
|
||||||
|
|
||||||
export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
sortedInfo: {},
|
sortedInfo: {},
|
||||||
|
filteredInfo: {},
|
||||||
});
|
});
|
||||||
|
const [isTvModeScheduledIn, setIsTvModeScheduledIn] = useLocalStorage(
|
||||||
|
"isTvModeScheduledIn",
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
if (!data) return null;
|
if (!data) return null;
|
||||||
if (!data.scheduled_in_today)
|
if (!data.scheduled_in_today)
|
||||||
return <DashboardRefreshRequired {...cardProps} />;
|
return <DashboardRefreshRequired {...cardProps} />;
|
||||||
@@ -31,6 +42,12 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
alt_transport: item.job.alt_transport,
|
alt_transport: item.job.alt_transport,
|
||||||
clm_no: item.job.clm_no,
|
clm_no: item.job.clm_no,
|
||||||
jobid: item.job.jobid,
|
jobid: item.job.jobid,
|
||||||
|
joblines_body: item.job.joblines
|
||||||
|
.filter((l) => l.mod_lbr_ty !== "LAR")
|
||||||
|
.reduce((acc, val) => acc + val.mod_lb_hrs, 0),
|
||||||
|
joblines_ref: item.job.joblines
|
||||||
|
.filter((l) => l.mod_lbr_ty === "LAR")
|
||||||
|
.reduce((acc, val) => acc + val.mod_lb_hrs, 0),
|
||||||
ins_co_nm: item.job.ins_co_nm,
|
ins_co_nm: item.job.ins_co_nm,
|
||||||
iouparent: item.job.iouparent,
|
iouparent: item.job.iouparent,
|
||||||
ownerid: item.job.ownerid,
|
ownerid: item.job.ownerid,
|
||||||
@@ -49,7 +66,7 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
v_vin: item.job.v_vin,
|
v_vin: item.job.v_vin,
|
||||||
vehicleid: item.job.vehicleid,
|
vehicleid: item.job.vehicleid,
|
||||||
note: item.note,
|
note: item.note,
|
||||||
start: moment(item.start).format("hh:mm a"),
|
start: item.start,
|
||||||
title: item.title,
|
title: item.title,
|
||||||
};
|
};
|
||||||
appt.push(i);
|
appt.push(i);
|
||||||
@@ -59,11 +76,192 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
return new moment(a.start) - new moment(b.start);
|
return new moment(a.start) - new moment(b.start);
|
||||||
});
|
});
|
||||||
|
|
||||||
const columns = [
|
const tvFontSize = 16;
|
||||||
|
const tvFontWeight = "bold";
|
||||||
|
|
||||||
|
const tvColumns = [
|
||||||
|
{
|
||||||
|
title: t("appointments.fields.time"),
|
||||||
|
dataIndex: "start",
|
||||||
|
key: "start",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => dateSort(a.start, b.start),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "start" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
<TimeFormatter>{record.start}</TimeFormatter>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.ro_number"),
|
title: t("jobs.fields.ro_number"),
|
||||||
dataIndex: "ro_number",
|
dataIndex: "ro_number",
|
||||||
key: "ro_number",
|
key: "ro_number",
|
||||||
|
sorter: (a, b) => alphaSort(a.ro_number, b.ro_number),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
|
<Link
|
||||||
|
to={"/manage/jobs/" + record.jobid}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
<Space>
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{record.ro_number || t("general.labels.na")}
|
||||||
|
{record.production_vars && record.production_vars.alert ? (
|
||||||
|
<ExclamationCircleFilled className="production-alert" />
|
||||||
|
) : null}
|
||||||
|
{record.suspended && (
|
||||||
|
<PauseCircleOutlined style={{ color: "orangered" }} />
|
||||||
|
)}
|
||||||
|
{record.iouparent && (
|
||||||
|
<Tooltip title={t("jobs.labels.iou")}>
|
||||||
|
<BranchesOutlined style={{ color: "orangered" }} />
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</Space>
|
||||||
|
</Link>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.owner"),
|
||||||
|
dataIndex: "owner",
|
||||||
|
key: "owner",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(OwnerNameDisplayFunction(a), OwnerNameDisplayFunction(b)),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "owner" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => {
|
||||||
|
return record.ownerid ? (
|
||||||
|
<Link
|
||||||
|
to={"/manage/owners/" + record.ownerid}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.vehicle"),
|
||||||
|
dataIndex: "vehicle",
|
||||||
|
key: "vehicle",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(
|
||||||
|
`${a.v_model_yr || ""} ${a.v_make_desc || ""} ${
|
||||||
|
a.v_model_desc || ""
|
||||||
|
}`,
|
||||||
|
`${b.v_model_yr || ""} ${b.v_make_desc || ""} ${b.v_model_desc || ""}`
|
||||||
|
),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "vehicle" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => {
|
||||||
|
return record.vehicleid ? (
|
||||||
|
<Link
|
||||||
|
to={"/manage/vehicles/" + record.vehicleid}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
||||||
|
record.v_model_desc || ""
|
||||||
|
}`}
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>{`${
|
||||||
|
record.v_model_yr || ""
|
||||||
|
} ${record.v_make_desc || ""} ${record.v_model_desc || ""}`}</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("appointments.fields.alt_transport"),
|
||||||
|
dataIndex: "alt_transport",
|
||||||
|
key: "alt_transport",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => alphaSort(a.alt_transport, b.alt_transport),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "alt_transport" &&
|
||||||
|
state.sortedInfo.order,
|
||||||
|
filters:
|
||||||
|
(appt &&
|
||||||
|
appt
|
||||||
|
.map((j) => j.alt_transport)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Alt. Transport",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.alt_transport),
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{record.alt_transport}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.lab"),
|
||||||
|
dataIndex: "joblines_body",
|
||||||
|
key: "joblines_body",
|
||||||
|
sorter: (a, b) => a.joblines_body - b.joblines_body,
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "joblines_body" &&
|
||||||
|
state.sortedInfo.order,
|
||||||
|
align: "right",
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{record.joblines_body.toFixed(1)}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.lar"),
|
||||||
|
dataIndex: "joblines_ref",
|
||||||
|
key: "joblines_ref",
|
||||||
|
sorter: (a, b) => a.joblines_ref - b.joblines_ref,
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "joblines_ref" && state.sortedInfo.order,
|
||||||
|
align: "right",
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{record.joblines_ref.toFixed(1)}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t("appointments.fields.time"),
|
||||||
|
dataIndex: "start",
|
||||||
|
key: "start",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => dateSort(a.start, b.start),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "start" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => <TimeFormatter>{record.start}</TimeFormatter>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.ro_number"),
|
||||||
|
dataIndex: "ro_number",
|
||||||
|
key: "ro_number",
|
||||||
|
sorter: (a, b) => alphaSort(a.ro_number, b.ro_number),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Link
|
<Link
|
||||||
to={"/manage/jobs/" + record.jobid}
|
to={"/manage/jobs/" + record.jobid}
|
||||||
@@ -91,7 +289,10 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
dataIndex: "owner",
|
dataIndex: "owner",
|
||||||
key: "owner",
|
key: "owner",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
responsive: ["md"],
|
sorter: (a, b) =>
|
||||||
|
alphaSort(OwnerNameDisplayFunction(a), OwnerNameDisplayFunction(b)),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "owner" && state.sortedInfo.order,
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.ownerid ? (
|
return record.ownerid ? (
|
||||||
<Link
|
<Link
|
||||||
@@ -108,23 +309,16 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.ownr_ph1"),
|
title: t("dashboard.labels.phone"),
|
||||||
dataIndex: "ownr_ph1",
|
dataIndex: "ownr_ph",
|
||||||
key: "ownr_ph1",
|
key: "ownr_ph",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
responsive: ["md"],
|
responsive: ["md"],
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<ChatOpenButton phone={record.ownr_ph1} jobid={record.jobid} />
|
<Space size="small" wrap>
|
||||||
),
|
<ChatOpenButton phone={record.ownr_ph1} jobid={record.jobid} />
|
||||||
},
|
<ChatOpenButton phone={record.ownr_ph2} jobid={record.jobid} />
|
||||||
{
|
</Space>
|
||||||
title: t("jobs.fields.ownr_ph2"),
|
|
||||||
dataIndex: "ownr_ph2",
|
|
||||||
key: "ownr_ph2",
|
|
||||||
ellipsis: true,
|
|
||||||
responsive: ["md"],
|
|
||||||
render: (text, record) => (
|
|
||||||
<ChatOpenButton phone={record.ownr_ph2} jobid={record.jobid} />
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -134,7 +328,7 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
responsive: ["md"],
|
responsive: ["md"],
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<ChatOpenButton phone={record.ownr_ea} jobid={record.jobid} />
|
<a href={`mailto:${record.ownr_ea}`}>{record.ownr_ea}</a>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -142,6 +336,15 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
dataIndex: "vehicle",
|
dataIndex: "vehicle",
|
||||||
key: "vehicle",
|
key: "vehicle",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(
|
||||||
|
`${a.v_model_yr || ""} ${a.v_make_desc || ""} ${
|
||||||
|
a.v_model_desc || ""
|
||||||
|
}`,
|
||||||
|
`${b.v_model_yr || ""} ${b.v_make_desc || ""} ${b.v_model_desc || ""}`
|
||||||
|
),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "vehicle" && state.sortedInfo.order,
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.vehicleid ? (
|
return record.vehicleid ? (
|
||||||
<Link
|
<Link
|
||||||
@@ -165,43 +368,80 @@ export default function DashboardScheduledInToday({ data, ...cardProps }) {
|
|||||||
key: "ins_co_nm",
|
key: "ins_co_nm",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
responsive: ["md"],
|
responsive: ["md"],
|
||||||
},
|
sorter: (a, b) => alphaSort(a.ins_co_nm, b.ins_co_nm),
|
||||||
{
|
sortOrder:
|
||||||
title: t("appointments.fields.time"),
|
state.sortedInfo.columnKey === "ins_co_nm" && state.sortedInfo.order,
|
||||||
dataIndex: "start",
|
filters:
|
||||||
key: "start",
|
(appt &&
|
||||||
ellipsis: true,
|
appt
|
||||||
responsive: ["md"],
|
.map((j) => j.ins_co_nm)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Ins. Co.*",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.ins_co_nm),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("appointments.fields.alt_transport"),
|
title: t("appointments.fields.alt_transport"),
|
||||||
dataIndex: "alt_transport",
|
dataIndex: "alt_transport",
|
||||||
key: "alt_transport",
|
key: "alt_transport",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
responsive: ["md"],
|
sorter: (a, b) => alphaSort(a.alt_transport, b.alt_transport),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "alt_transport" &&
|
||||||
|
state.sortedInfo.order,
|
||||||
|
filters:
|
||||||
|
(appt &&
|
||||||
|
appt
|
||||||
|
.map((j) => j.alt_transport)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Alt. Transport",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.alt_transport),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleTableChange = (sorter) => {
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
setState({ ...state, sortedInfo: sorter });
|
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
title={t("dashboard.titles.scheduledintoday", {
|
title={t("dashboard.titles.scheduledindate", {
|
||||||
date: moment().startOf("day").format("MM/DD/YYYY"),
|
date: moment().startOf("day").format("MM/DD/YYYY"),
|
||||||
})}
|
})}
|
||||||
|
extra={
|
||||||
|
<Space>
|
||||||
|
<Typography.Text>{t("general.labels.tvmode")}</Typography.Text>
|
||||||
|
<Switch
|
||||||
|
onClick={() => setIsTvModeScheduledIn(!isTvModeScheduledIn)}
|
||||||
|
defaultChecked={isTvModeScheduledIn}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
{...cardProps}
|
{...cardProps}
|
||||||
>
|
>
|
||||||
<div style={{ height: "100%" }}>
|
<div style={{ height: "100%" }}>
|
||||||
<Table
|
<Table
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
pagination={{ position: "top", defaultPageSize: pageLimit }}
|
pagination={false}
|
||||||
columns={columns}
|
columns={isTvModeScheduledIn ? tvColumns : columns}
|
||||||
scroll={{ x: true, y: "calc(100% - 2em)" }}
|
scroll={{ x: true, y: "calc(100% - 2em)" }}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
style={{ height: "85%" }}
|
style={{ height: "85%" }}
|
||||||
dataSource={appt}
|
dataSource={appt}
|
||||||
|
size={isTvModeScheduledIn ? "small" : "middle"}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
@@ -220,6 +460,10 @@ export const DashboardScheduledInTodayGql = `
|
|||||||
alt_transport
|
alt_transport
|
||||||
clm_no
|
clm_no
|
||||||
jobid: id
|
jobid: id
|
||||||
|
joblines(where: {removed: {_eq: false}}) {
|
||||||
|
mod_lb_hrs
|
||||||
|
mod_lbr_ty
|
||||||
|
}
|
||||||
ins_co_nm
|
ins_co_nm
|
||||||
iouparent
|
iouparent
|
||||||
ownerid
|
ownerid
|
||||||
|
|||||||
@@ -3,37 +3,272 @@ import {
|
|||||||
ExclamationCircleFilled,
|
ExclamationCircleFilled,
|
||||||
PauseCircleOutlined,
|
PauseCircleOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { Card, Space, Table, Tooltip } from "antd";
|
import { Card, Space, Switch, Table, Tooltip, Typography } 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 { useTranslation } from "react-i18next";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
import { TimeFormatter } from "../../../utils/DateFormatter";
|
||||||
|
import { onlyUnique } from "../../../utils/arrayHelper";
|
||||||
|
import { alphaSort, dateSort } from "../../../utils/sorters";
|
||||||
|
import useLocalStorage from "../../../utils/useLocalStorage";
|
||||||
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";
|
import OwnerNameDisplay, {
|
||||||
|
OwnerNameDisplayFunction,
|
||||||
|
} from "../../owner-name-display/owner-name-display.component";
|
||||||
import DashboardRefreshRequired from "../refresh-required.component";
|
import DashboardRefreshRequired from "../refresh-required.component";
|
||||||
import {pageLimit} from "../../../utils/config";
|
|
||||||
|
|
||||||
export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
sortedInfo: {},
|
sortedInfo: {},
|
||||||
|
filteredInfo: {},
|
||||||
});
|
});
|
||||||
|
const [isTvModeScheduledOut, setIsTvModeScheduledOut] = useLocalStorage(
|
||||||
|
"isTvModeScheduledOut",
|
||||||
|
false
|
||||||
|
);
|
||||||
|
|
||||||
if (!data) return null;
|
if (!data) return null;
|
||||||
if (!data.scheduled_out_today)
|
if (!data.scheduled_out_today)
|
||||||
return <DashboardRefreshRequired {...cardProps} />;
|
return <DashboardRefreshRequired {...cardProps} />;
|
||||||
|
|
||||||
data.scheduled_out_today.forEach((item) => {
|
data.scheduled_out_today.forEach((item) => {
|
||||||
item.scheduled_completion= moment(item.scheduled_completion).format("hh:mm a")
|
item.joblines_body = item.joblines
|
||||||
|
? item.joblines
|
||||||
|
.filter((l) => l.mod_lbr_ty !== "LAR")
|
||||||
|
.reduce((acc, val) => acc + val.mod_lb_hrs, 0)
|
||||||
|
: 0;
|
||||||
|
item.joblines_ref = item.joblines
|
||||||
|
? item.joblines
|
||||||
|
.filter((l) => l.mod_lbr_ty === "LAR")
|
||||||
|
.reduce((acc, val) => acc + val.mod_lb_hrs, 0)
|
||||||
|
: 0;
|
||||||
});
|
});
|
||||||
data.scheduled_out_today.sort(function (a, b) {
|
data.scheduled_out_today.sort(function (a, b) {
|
||||||
return new Date(a.scheduled_completion) - new Date(b.scheduled_completion);
|
return new Date(a.scheduled_completion) - new Date(b.scheduled_completion);
|
||||||
});
|
});
|
||||||
|
|
||||||
const columns = [
|
const tvFontSize = 18;
|
||||||
|
const tvFontWeight = "bold";
|
||||||
|
|
||||||
|
const tvColumns = [
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.scheduled_completion"),
|
||||||
|
dataIndex: "scheduled_completion",
|
||||||
|
key: "scheduled_completion",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
dateSort(a.scheduled_completion, b.scheduled_completion),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "scheduled_completion" &&
|
||||||
|
state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
<TimeFormatter>{record.scheduled_completion}</TimeFormatter>
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.ro_number"),
|
title: t("jobs.fields.ro_number"),
|
||||||
dataIndex: "ro_number",
|
dataIndex: "ro_number",
|
||||||
key: "ro_number",
|
key: "ro_number",
|
||||||
|
sorter: (a, b) => alphaSort(a.ro_number, b.ro_number),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
|
<Link
|
||||||
|
to={"/manage/jobs/" + record.jobid}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
<Space>
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{record.ro_number || t("general.labels.na")}
|
||||||
|
{record.production_vars && record.production_vars.alert ? (
|
||||||
|
<ExclamationCircleFilled className="production-alert" />
|
||||||
|
) : null}
|
||||||
|
{record.suspended && (
|
||||||
|
<PauseCircleOutlined style={{ color: "orangered" }} />
|
||||||
|
)}
|
||||||
|
{record.iouparent && (
|
||||||
|
<Tooltip title={t("jobs.labels.iou")}>
|
||||||
|
<BranchesOutlined style={{ color: "orangered" }} />
|
||||||
|
</Tooltip>
|
||||||
|
)}
|
||||||
|
</span>
|
||||||
|
</Space>
|
||||||
|
</Link>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.owner"),
|
||||||
|
dataIndex: "owner",
|
||||||
|
key: "owner",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(OwnerNameDisplayFunction(a), OwnerNameDisplayFunction(b)),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "owner" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => {
|
||||||
|
return record.ownerid ? (
|
||||||
|
<Link
|
||||||
|
to={"/manage/owners/" + record.ownerid}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.vehicle"),
|
||||||
|
dataIndex: "vehicle",
|
||||||
|
key: "vehicle",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(
|
||||||
|
`${a.v_model_yr || ""} ${a.v_make_desc || ""} ${
|
||||||
|
a.v_model_desc || ""
|
||||||
|
}`,
|
||||||
|
`${b.v_model_yr || ""} ${b.v_make_desc || ""} ${b.v_model_desc || ""}`
|
||||||
|
),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "vehicle" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => {
|
||||||
|
return record.vehicleid ? (
|
||||||
|
<Link
|
||||||
|
to={"/manage/vehicles/" + record.vehicleid}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
||||||
|
record.v_model_desc || ""
|
||||||
|
}`}
|
||||||
|
</span>
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>{`${
|
||||||
|
record.v_model_yr || ""
|
||||||
|
} ${record.v_make_desc || ""} ${record.v_model_desc || ""}`}</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("appointments.fields.alt_transport"),
|
||||||
|
dataIndex: "alt_transport",
|
||||||
|
key: "alt_transport",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => alphaSort(a.alt_transport, b.alt_transport),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "alt_transport" &&
|
||||||
|
state.sortedInfo.order,
|
||||||
|
filters:
|
||||||
|
(data.scheduled_out_today &&
|
||||||
|
data.scheduled_out_today
|
||||||
|
.map((j) => j.alt_transport)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Alt. Transport*",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.alt_transport),
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{record.alt_transport}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.status"),
|
||||||
|
dataIndex: "status",
|
||||||
|
key: "status",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => alphaSort(a.alt_transport, b.alt_transport),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||||
|
filters:
|
||||||
|
(data.scheduled_out_today &&
|
||||||
|
data.scheduled_out_today
|
||||||
|
.map((j) => j.status)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Status*",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.status),
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{record.status}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.lab"),
|
||||||
|
dataIndex: "joblines_body",
|
||||||
|
key: "joblines_body",
|
||||||
|
sorter: (a, b) => a.joblines_body - b.joblines_body,
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "joblines_body" &&
|
||||||
|
state.sortedInfo.order,
|
||||||
|
align: "right",
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{record.joblines_body.toFixed(1)}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.lar"),
|
||||||
|
dataIndex: "joblines_ref",
|
||||||
|
key: "joblines_ref",
|
||||||
|
sorter: (a, b) => a.joblines_ref - b.joblines_ref,
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "joblines_ref" && state.sortedInfo.order,
|
||||||
|
align: "right",
|
||||||
|
render: (text, record) => (
|
||||||
|
<span style={{ fontSize: tvFontSize, fontWeight: tvFontWeight }}>
|
||||||
|
{record.joblines_ref.toFixed(1)}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.scheduled_completion"),
|
||||||
|
dataIndex: "scheduled_completion",
|
||||||
|
key: "scheduled_completion",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
dateSort(a.scheduled_completion, b.scheduled_completion),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "scheduled_completion" &&
|
||||||
|
state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
|
<TimeFormatter>{record.scheduled_completion}</TimeFormatter>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.ro_number"),
|
||||||
|
dataIndex: "ro_number",
|
||||||
|
key: "ro_number",
|
||||||
|
sorter: (a, b) => alphaSort(a.ro_number, b.ro_number),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Link
|
<Link
|
||||||
to={"/manage/jobs/" + record.jobid}
|
to={"/manage/jobs/" + record.jobid}
|
||||||
@@ -61,7 +296,10 @@ export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
|||||||
dataIndex: "owner",
|
dataIndex: "owner",
|
||||||
key: "owner",
|
key: "owner",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
responsive: ["md"],
|
sorter: (a, b) =>
|
||||||
|
alphaSort(OwnerNameDisplayFunction(a), OwnerNameDisplayFunction(b)),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "owner" && state.sortedInfo.order,
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.ownerid ? (
|
return record.ownerid ? (
|
||||||
<Link
|
<Link
|
||||||
@@ -78,23 +316,16 @@ export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.ownr_ph1"),
|
title: t("dashboard.labels.phone"),
|
||||||
dataIndex: "ownr_ph1",
|
dataIndex: "ownr_ph",
|
||||||
key: "ownr_ph1",
|
key: "ownr_ph",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
responsive: ["md"],
|
responsive: ["md"],
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<ChatOpenButton phone={record.ownr_ph1} jobid={record.jobid} />
|
<Space size="small" wrap>
|
||||||
),
|
<ChatOpenButton phone={record.ownr_ph1} jobid={record.jobid} />
|
||||||
},
|
<ChatOpenButton phone={record.ownr_ph2} jobid={record.jobid} />
|
||||||
{
|
</Space>
|
||||||
title: t("jobs.fields.ownr_ph2"),
|
|
||||||
dataIndex: "ownr_ph2",
|
|
||||||
key: "ownr_ph2",
|
|
||||||
ellipsis: true,
|
|
||||||
responsive: ["md"],
|
|
||||||
render: (text, record) => (
|
|
||||||
<ChatOpenButton phone={record.ownr_ph2} jobid={record.jobid} />
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -104,7 +335,7 @@ export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
|||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
responsive: ["md"],
|
responsive: ["md"],
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<ChatOpenButton phone={record.ownr_ea} jobid={record.jobid} />
|
<a href={`mailto:${record.ownr_ea}`}>{record.ownr_ea}</a>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -112,6 +343,15 @@ export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
|||||||
dataIndex: "vehicle",
|
dataIndex: "vehicle",
|
||||||
key: "vehicle",
|
key: "vehicle",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(
|
||||||
|
`${a.v_model_yr || ""} ${a.v_make_desc || ""} ${
|
||||||
|
a.v_model_desc || ""
|
||||||
|
}`,
|
||||||
|
`${b.v_model_yr || ""} ${b.v_make_desc || ""} ${b.v_model_desc || ""}`
|
||||||
|
),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "vehicle" && state.sortedInfo.order,
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.vehicleid ? (
|
return record.vehicleid ? (
|
||||||
<Link
|
<Link
|
||||||
@@ -135,43 +375,80 @@ export default function DashboardScheduledOutToday({ data, ...cardProps }) {
|
|||||||
key: "ins_co_nm",
|
key: "ins_co_nm",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
responsive: ["md"],
|
responsive: ["md"],
|
||||||
},
|
sorter: (a, b) => alphaSort(a.ins_co_nm, b.ins_co_nm),
|
||||||
{
|
sortOrder:
|
||||||
title: t("jobs.fields.scheduled_completion"),
|
state.sortedInfo.columnKey === "ins_co_nm" && state.sortedInfo.order,
|
||||||
dataIndex: "scheduled_completion",
|
filters:
|
||||||
key: "scheduled_completion",
|
(data.scheduled_out_today &&
|
||||||
ellipsis: true,
|
data.scheduled_out_today
|
||||||
responsive: ["md"],
|
.map((j) => j.ins_co_nm)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Ins. Co.*",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.ins_co_nm),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("appointments.fields.alt_transport"),
|
title: t("appointments.fields.alt_transport"),
|
||||||
dataIndex: "alt_transport",
|
dataIndex: "alt_transport",
|
||||||
key: "alt_transport",
|
key: "alt_transport",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
responsive: ["md"],
|
sorter: (a, b) => alphaSort(a.alt_transport, b.alt_transport),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "alt_transport" &&
|
||||||
|
state.sortedInfo.order,
|
||||||
|
filters:
|
||||||
|
(data.scheduled_out_today &&
|
||||||
|
data.scheduled_out_today
|
||||||
|
.map((j) => j.alt_transport)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Alt. Transport*",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.alt_transport),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const handleTableChange = (sorter) => {
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
setState({ ...state, sortedInfo: sorter });
|
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
title={t("dashboard.titles.scheduledouttoday", {
|
title={t("dashboard.titles.scheduledoutdate", {
|
||||||
date: moment().startOf("day").format("MM/DD/YYYY"),
|
date: moment().startOf("day").format("MM/DD/YYYY"),
|
||||||
})}
|
})}
|
||||||
|
extra={
|
||||||
|
<Space>
|
||||||
|
<Typography.Text>{t("general.labels.tvmode")}</Typography.Text>
|
||||||
|
<Switch
|
||||||
|
onClick={() => setIsTvModeScheduledOut(!isTvModeScheduledOut)}
|
||||||
|
defaultChecked={isTvModeScheduledOut}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
{...cardProps}
|
{...cardProps}
|
||||||
>
|
>
|
||||||
<div style={{ height: "100%" }}>
|
<div style={{ height: "100%" }}>
|
||||||
<Table
|
<Table
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
pagination={{ position: "top", defaultPageSize: pageLimit }}
|
pagination={false}
|
||||||
columns={columns}
|
columns={isTvModeScheduledOut ? tvColumns : columns}
|
||||||
scroll={{ x: true, y: "calc(100% - 2em)" }}
|
scroll={{ x: true, y: "calc(100% - 2em)" }}
|
||||||
rowKey="id"
|
rowKey="id"
|
||||||
style={{ height: "85%" }}
|
style={{ height: "85%" }}
|
||||||
dataSource={data.scheduled_out_today}
|
dataSource={data.scheduled_out_today}
|
||||||
|
size={isTvModeScheduledOut ? "small" : "middle"}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</Card>
|
</Card>
|
||||||
@@ -188,6 +465,10 @@ export const DashboardScheduledOutTodayGql = `
|
|||||||
alt_transport
|
alt_transport
|
||||||
clm_no
|
clm_no
|
||||||
jobid: id
|
jobid: id
|
||||||
|
joblines(where: {removed: {_eq: false}}) {
|
||||||
|
mod_lb_hrs
|
||||||
|
mod_lbr_ty
|
||||||
|
}
|
||||||
ins_co_nm
|
ins_co_nm
|
||||||
iouparent
|
iouparent
|
||||||
ownerid
|
ownerid
|
||||||
@@ -200,6 +481,7 @@ export const DashboardScheduledOutTodayGql = `
|
|||||||
production_vars
|
production_vars
|
||||||
ro_number
|
ro_number
|
||||||
scheduled_completion
|
scheduled_completion
|
||||||
|
status
|
||||||
suspended
|
suspended
|
||||||
v_make_desc
|
v_make_desc
|
||||||
v_model_desc
|
v_model_desc
|
||||||
|
|||||||
@@ -275,26 +275,22 @@ const componentList = {
|
|||||||
h: 2,
|
h: 2,
|
||||||
},
|
},
|
||||||
ScheduleInToday: {
|
ScheduleInToday: {
|
||||||
label: i18next.t("dashboard.titles.scheduledintoday", {
|
label: i18next.t("dashboard.titles.scheduledintoday"),
|
||||||
date: moment().startOf("day").format("MM/DD/YYYY"),
|
|
||||||
}),
|
|
||||||
component: DashboardScheduledInToday,
|
component: DashboardScheduledInToday,
|
||||||
gqlFragment: DashboardScheduledInTodayGql,
|
gqlFragment: DashboardScheduledInTodayGql,
|
||||||
minW: 10,
|
minW: 6,
|
||||||
minH: 2,
|
minH: 2,
|
||||||
w: 10,
|
w: 10,
|
||||||
h: 2,
|
h: 3,
|
||||||
},
|
},
|
||||||
ScheduleOutToday: {
|
ScheduleOutToday: {
|
||||||
label: i18next.t("dashboard.titles.scheduledouttoday", {
|
label: i18next.t("dashboard.titles.scheduledouttoday"),
|
||||||
date: moment().startOf("day").format("MM/DD/YYYY"),
|
|
||||||
}),
|
|
||||||
component: DashboardScheduledOutToday,
|
component: DashboardScheduledOutToday,
|
||||||
gqlFragment: DashboardScheduledOutTodayGql,
|
gqlFragment: DashboardScheduledOutTodayGql,
|
||||||
minW: 10,
|
minW: 6,
|
||||||
minH: 2,
|
minH: 2,
|
||||||
w: 10,
|
w: 10,
|
||||||
h: 2,
|
h: 3,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -306,8 +302,7 @@ const createDashboardQuery = (state) => {
|
|||||||
.map((item, index) => componentList[item.i].gqlFragment || "")
|
.map((item, index) => componentList[item.i].gqlFragment || "")
|
||||||
.join("");
|
.join("");
|
||||||
return gql`
|
return gql`
|
||||||
query QUERY_DASHBOARD_DETAILS {
|
query QUERY_DASHBOARD_DETAILS { ${componentBasedAdditions || ""}
|
||||||
${componentBasedAdditions || ""}
|
|
||||||
monthly_sales: jobs(where: {_and: [
|
monthly_sales: jobs(where: {_and: [
|
||||||
{ voided: {_eq: false}},
|
{ voided: {_eq: false}},
|
||||||
{date_invoiced: {_gte: "${moment()
|
{date_invoiced: {_gte: "${moment()
|
||||||
@@ -317,11 +312,11 @@ const createDashboardQuery = (state) => {
|
|||||||
.endOf("month")
|
.endOf("month")
|
||||||
.endOf("day")
|
.endOf("day")
|
||||||
.toISOString()}"}}]}) {
|
.toISOString()}"}}]}) {
|
||||||
id
|
id
|
||||||
ro_number
|
ro_number
|
||||||
date_invoiced
|
date_invoiced
|
||||||
job_totals
|
job_totals
|
||||||
rate_la1
|
rate_la1
|
||||||
rate_la2
|
rate_la2
|
||||||
rate_la3
|
rate_la3
|
||||||
rate_la4
|
rate_la4
|
||||||
@@ -344,43 +339,42 @@ const createDashboardQuery = (state) => {
|
|||||||
rate_mapa
|
rate_mapa
|
||||||
rate_mash
|
rate_mash
|
||||||
rate_matd
|
rate_matd
|
||||||
joblines(where: { removed: { _eq: false } }) {
|
joblines(where: { removed: { _eq: false } }) {
|
||||||
id
|
id
|
||||||
mod_lbr_ty
|
mod_lbr_ty
|
||||||
mod_lb_hrs
|
mod_lb_hrs
|
||||||
act_price
|
act_price
|
||||||
part_qty
|
part_qty
|
||||||
part_type
|
part_type
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
production_jobs: jobs(where: { inproduction: { _eq: true } }) {
|
||||||
production_jobs: jobs(where: { inproduction: { _eq: true } }) {
|
id
|
||||||
|
ro_number
|
||||||
|
ins_co_nm
|
||||||
|
job_totals
|
||||||
|
joblines(where: { removed: { _eq: false } }) {
|
||||||
id
|
id
|
||||||
ro_number
|
mod_lbr_ty
|
||||||
ins_co_nm
|
mod_lb_hrs
|
||||||
job_totals
|
act_price
|
||||||
joblines(where: { removed: { _eq: false } }) {
|
part_qty
|
||||||
id
|
part_type
|
||||||
mod_lbr_ty
|
}
|
||||||
mod_lb_hrs
|
labhrs: joblines_aggregate(where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }) {
|
||||||
act_price
|
aggregate {
|
||||||
part_qty
|
sum {
|
||||||
part_type
|
mod_lb_hrs
|
||||||
}
|
|
||||||
labhrs: joblines_aggregate(where: { mod_lbr_ty: { _neq: "LAR" }, removed: { _eq: false } }) {
|
|
||||||
aggregate {
|
|
||||||
sum {
|
|
||||||
mod_lb_hrs
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
larhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }) {
|
}
|
||||||
aggregate {
|
larhrs: joblines_aggregate(where: { mod_lbr_ty: { _eq: "LAR" }, removed: { _eq: false } }) {
|
||||||
sum {
|
aggregate {
|
||||||
mod_lb_hrs
|
sum {
|
||||||
}
|
mod_lb_hrs
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
`;
|
}`;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -128,7 +128,7 @@
|
|||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
.ant-card-body {
|
.ant-card-body {
|
||||||
height: 80%;
|
height: calc(100% - 2rem);
|
||||||
width: 100%;
|
width: 100%;
|
||||||
// // background-color: red;
|
// // background-color: red;
|
||||||
// height: 90%;
|
// height: 90%;
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import { Select, Space, Tag } from "antd";
|
import { Select, Space, Tag } from "antd";
|
||||||
import React, { forwardRef } from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
const { Option } = Select;
|
const { Option } = Select;
|
||||||
//To be used as a form element only.
|
//To be used as a form element only.
|
||||||
|
|
||||||
const EmployeeSearchSelect = ({ options, ...props }, ref) => {
|
const EmployeeSearchSelect = ({ options, ...props }) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -39,4 +39,4 @@ const EmployeeSearchSelect = ({ options, ...props }, ref) => {
|
|||||||
</Select>
|
</Select>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
export default forwardRef(EmployeeSearchSelect);
|
export default EmployeeSearchSelect;
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
import { useQuery } from "@apollo/client";
|
||||||
|
import { Select } from "antd";
|
||||||
|
import React, { forwardRef } from "react";
|
||||||
|
import { QUERY_TEAMS } from "../../graphql/employee_teams.queries";
|
||||||
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
|
||||||
|
//To be used as a form element only.
|
||||||
|
|
||||||
|
const EmployeeTeamSearchSelect = ({ ...props }, ref) => {
|
||||||
|
const { loading, error, data } = useQuery(QUERY_TEAMS);
|
||||||
|
|
||||||
|
if (error) return <AlertComponent message={JSON.stringify(error)} />;
|
||||||
|
return (
|
||||||
|
<Select
|
||||||
|
showSearch
|
||||||
|
allowClear
|
||||||
|
loading={loading}
|
||||||
|
style={{
|
||||||
|
width: 400,
|
||||||
|
}}
|
||||||
|
options={
|
||||||
|
data
|
||||||
|
? data.employee_teams.map((e) => ({
|
||||||
|
value: JSON.stringify(e),
|
||||||
|
label: e.name,
|
||||||
|
}))
|
||||||
|
: []
|
||||||
|
}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default forwardRef(EmployeeTeamSearchSelect);
|
||||||
@@ -2,7 +2,7 @@ import { Button, Col, Collapse, Result, Row, Space } from "antd";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { withTranslation } from "react-i18next";
|
import { withTranslation } from "react-i18next";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
|
import * as Sentry from "@sentry/react";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import {
|
import {
|
||||||
@@ -40,22 +40,22 @@ class ErrorBoundary extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleErrorSubmit = () => {
|
handleErrorSubmit = () => {
|
||||||
window.$crisp.push([
|
// window.$crisp.push([
|
||||||
"do",
|
// "do",
|
||||||
"message:send",
|
// "message:send",
|
||||||
[
|
// [
|
||||||
"text",
|
// "text",
|
||||||
`I hit the following error: \n\n
|
// `I hit the following error: \n\n
|
||||||
${this.state.error.message}\n\n
|
// ${this.state.error.message}\n\n
|
||||||
${this.state.error.stack}\n\n
|
// ${this.state.error.stack}\n\n
|
||||||
URL:${window.location} as ${this.props.currentUser.email} for ${
|
// URL:${window.location} as ${this.props.currentUser.email} for ${
|
||||||
this.props.bodyshop && this.props.bodyshop.name
|
// this.props.bodyshop && this.props.bodyshop.name
|
||||||
}
|
// }
|
||||||
`,
|
// `,
|
||||||
],
|
// ],
|
||||||
]);
|
// ]);
|
||||||
|
|
||||||
window.$crisp.push(["do", "chat:open"]);
|
// window.$crisp.push(["do", "chat:open"]);
|
||||||
// const errorDescription = `**Please add relevant details about what you were doing before you encountered this issue**
|
// const errorDescription = `**Please add relevant details about what you were doing before you encountered this issue**
|
||||||
|
|
||||||
// ----
|
// ----
|
||||||
@@ -138,7 +138,6 @@ class ErrorBoundary extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(
|
export default Sentry.withErrorBoundary(
|
||||||
mapStateToProps,
|
connect(mapStateToProps, mapDispatchToProps)(withTranslation()(ErrorBoundary))
|
||||||
mapDispatchToProps
|
);
|
||||||
)(withTranslation()(ErrorBoundary));
|
|
||||||
|
|||||||
@@ -1,9 +1,26 @@
|
|||||||
import Dinero from "dinero.js";
|
import Dinero from "dinero.js";
|
||||||
import React, { forwardRef } from "react";
|
import React, { forwardRef } from "react";
|
||||||
|
|
||||||
const ReadOnlyFormItem = ({ value, type = "text", onChange }, ref) => {
|
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))
|
||||||
|
});
|
||||||
|
|
||||||
|
const ReadOnlyFormItem = (
|
||||||
|
{ bodyshop, value, type = "text", onChange },
|
||||||
|
ref
|
||||||
|
) => {
|
||||||
if (!value) return null;
|
if (!value) return null;
|
||||||
switch (type) {
|
switch (type) {
|
||||||
|
case "employee":
|
||||||
|
const emp = bodyshop.employees.find((e) => e.id === value);
|
||||||
|
return `${emp?.first_name} ${emp?.last_name}`;
|
||||||
|
|
||||||
case "text":
|
case "text":
|
||||||
return <div>{value}</div>;
|
return <div>{value}</div>;
|
||||||
case "currency":
|
case "currency":
|
||||||
@@ -14,4 +31,8 @@ const ReadOnlyFormItem = ({ value, type = "text", onChange }, ref) => {
|
|||||||
return <div>{value}</div>;
|
return <div>{value}</div>;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
export default forwardRef(ReadOnlyFormItem);
|
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(forwardRef(ReadOnlyFormItem));
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import Icon, {
|
|||||||
//GlobalOutlined,
|
//GlobalOutlined,
|
||||||
HomeFilled,
|
HomeFilled,
|
||||||
ImportOutlined,
|
ImportOutlined,
|
||||||
|
// InfoCircleOutlined,
|
||||||
LineChartOutlined,
|
LineChartOutlined,
|
||||||
PaperClipOutlined,
|
PaperClipOutlined,
|
||||||
PhoneOutlined,
|
PhoneOutlined,
|
||||||
@@ -26,8 +27,11 @@ import Icon, {
|
|||||||
UserOutlined,
|
UserOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { useTreatments } from "@splitsoftware/splitio-react";
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Layout, Menu } from "antd";
|
import {
|
||||||
import React from "react";
|
Layout,
|
||||||
|
Menu, // Switch, Tooltip
|
||||||
|
} from "antd";
|
||||||
|
import React from "react"; //, { useEffect, useState }
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { BsKanban } from "react-icons/bs";
|
import { BsKanban } from "react-icons/bs";
|
||||||
import {
|
import {
|
||||||
@@ -52,6 +56,7 @@ import {
|
|||||||
selectBodyshop,
|
selectBodyshop,
|
||||||
selectCurrentUser,
|
selectCurrentUser,
|
||||||
} from "../../redux/user/user.selectors";
|
} from "../../redux/user/user.selectors";
|
||||||
|
//import { handleBeta, setBeta, checkBeta } from "../../utils/handleBeta";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
@@ -102,9 +107,21 @@ function Header({
|
|||||||
{},
|
{},
|
||||||
bodyshop && bodyshop.imexshopid
|
bodyshop && bodyshop.imexshopid
|
||||||
);
|
);
|
||||||
|
//const [betaSwitch, setBetaSwitch] = useState(false);
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
// useEffect(() => {
|
||||||
|
// const isBeta = checkBeta();
|
||||||
|
// setBetaSwitch(isBeta);
|
||||||
|
// }, []);
|
||||||
|
|
||||||
|
// const betaSwitchChange = (checked) => {
|
||||||
|
// setBeta(checked);
|
||||||
|
// setBetaSwitch(checked);
|
||||||
|
// handleBeta();
|
||||||
|
// };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Layout.Header>
|
<Layout.Header>
|
||||||
<Menu
|
<Menu
|
||||||
@@ -268,6 +285,13 @@ function Header({
|
|||||||
{t("menus.header.timetickets")}
|
{t("menus.header.timetickets")}
|
||||||
</Link>
|
</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
{bodyshop?.md_tasks_presets?.use_approvals && (
|
||||||
|
<Menu.Item key="ttapprovals" icon={<FieldTimeOutlined />}>
|
||||||
|
<Link to="/manage/ttapprovals">
|
||||||
|
{t("menus.header.ttapprovals")}
|
||||||
|
</Link>
|
||||||
|
</Menu.Item>
|
||||||
|
)}
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
key="entertimetickets"
|
key="entertimetickets"
|
||||||
icon={<Icon component={GiPlayerTime} />}
|
icon={<Icon component={GiPlayerTime} />}
|
||||||
@@ -382,20 +406,12 @@ function Header({
|
|||||||
<Menu.Item
|
<Menu.Item
|
||||||
key="help"
|
key="help"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
window.open("https://help.imex.online/", "_blank");
|
window.open("https://rometech.com/", "_blank");
|
||||||
}}
|
}}
|
||||||
icon={<Icon component={QuestionCircleFilled} />}
|
icon={<Icon component={QuestionCircleFilled} />}
|
||||||
>
|
>
|
||||||
{t("menus.header.help")}
|
{t("menus.header.help")}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.Item
|
|
||||||
key="rescue"
|
|
||||||
onClick={() => {
|
|
||||||
window.open("https://imexrescue.com/", "_blank");
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{t("menus.header.rescueme")}
|
|
||||||
</Menu.Item>
|
|
||||||
<Menu.Item key="shiftclock">
|
<Menu.Item key="shiftclock">
|
||||||
<Link to="/manage/shiftclock">{t("menus.header.shiftclock")}</Link>
|
<Link to="/manage/shiftclock">{t("menus.header.shiftclock")}</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
@@ -431,6 +447,18 @@ function Header({
|
|||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
))}
|
))}
|
||||||
</Menu.SubMenu>
|
</Menu.SubMenu>
|
||||||
|
{
|
||||||
|
// <Menu.Item style={{marginLeft: 'auto'}} key="profile">
|
||||||
|
// <Tooltip title="A more modern ImEX Online is ready for you to try! You can switch back at any time.">
|
||||||
|
// <InfoCircleOutlined/>
|
||||||
|
// <span style={{marginRight: 8}}>Try the new ImEX Online</span>
|
||||||
|
// <Switch
|
||||||
|
// checked={betaSwitch}
|
||||||
|
// onChange={betaSwitchChange}
|
||||||
|
// />
|
||||||
|
// </Tooltip>
|
||||||
|
// </Menu.Item>
|
||||||
|
}
|
||||||
</Menu>
|
</Menu>
|
||||||
</Layout.Header>
|
</Layout.Header>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -87,7 +87,8 @@ export default function JobBillsTotalComponent({
|
|||||||
const totalPartsSublet = Dinero(totals.parts.parts.total)
|
const totalPartsSublet = Dinero(totals.parts.parts.total)
|
||||||
.add(Dinero(totals.parts.sublets.total))
|
.add(Dinero(totals.parts.sublets.total))
|
||||||
.add(Dinero(totals.additional.shipping))
|
.add(Dinero(totals.additional.shipping))
|
||||||
.add(Dinero(totals.additional.towing));
|
.add(Dinero(totals.additional.towing))
|
||||||
|
.add(Dinero(totals.additional.additionalCosts));
|
||||||
|
|
||||||
const discrepancy = totalPartsSublet.subtract(billTotals);
|
const discrepancy = totalPartsSublet.subtract(billTotals);
|
||||||
|
|
||||||
|
|||||||
@@ -1,47 +1,52 @@
|
|||||||
import { Button, notification } from "antd";
|
import { Button, notification } from "antd";
|
||||||
import Axios from "axios";
|
import Axios from "axios";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useMutation } from "@apollo/client";
|
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
export default function JobCalculateTotals({ job, disabled, refetch }) {
|
||||||
import Dinero from "dinero.js";
|
|
||||||
export default function JobCalculateTotals({ job, disabled }) {
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [updateJob] = useMutation(UPDATE_JOB);
|
|
||||||
|
|
||||||
const handleCalculate = async () => {
|
const handleCalculate = async () => {
|
||||||
setLoading(true);
|
try {
|
||||||
const newTotals = (
|
setLoading(true);
|
||||||
await Axios.post("/job/totals", {
|
|
||||||
job: job,
|
|
||||||
})
|
|
||||||
).data;
|
|
||||||
|
|
||||||
const result = await updateJob({
|
await Axios.post("/job/totalsssu", {
|
||||||
refetchQueries: ["GET_JOB_BY_PK"],
|
id: job.id,
|
||||||
awaitRefetchQueries: true,
|
});
|
||||||
variables: {
|
|
||||||
jobId: job.id,
|
if (refetch) refetch();
|
||||||
job: {
|
// const result = await updateJob({
|
||||||
job_totals: newTotals,
|
// refetchQueries: ["GET_JOB_BY_PK"],
|
||||||
clm_total: Dinero(newTotals.totals.total_repairs).toFormat("0.00"),
|
// awaitRefetchQueries: true,
|
||||||
owner_owing: Dinero(newTotals.totals.custPayable.total).toFormat(
|
// variables: {
|
||||||
"0.00"
|
// jobId: job.id,
|
||||||
),
|
// job: {
|
||||||
},
|
// job_totals: newTotals,
|
||||||
},
|
// clm_total: Dinero(newTotals.totals.total_repairs).toFormat("0.00"),
|
||||||
});
|
// owner_owing: Dinero(newTotals.totals.custPayable.total).toFormat(
|
||||||
if (!!!result.errors) {
|
// "0.00"
|
||||||
notification["success"]({ message: t("jobs.successes.updated") });
|
// ),
|
||||||
} else {
|
// },
|
||||||
|
// },
|
||||||
|
// });
|
||||||
|
// if (!!!result.errors) {
|
||||||
|
// notification["success"]({ message: t("jobs.successes.updated") });
|
||||||
|
// } else {
|
||||||
|
// notification["error"]({
|
||||||
|
// message: t("jobs.errors.updating", {
|
||||||
|
// error: JSON.stringify(result.errors),
|
||||||
|
// }),
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
} catch (error) {
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("jobs.errors.updating", {
|
message: t("jobs.errors.updating", {
|
||||||
error: JSON.stringify(result.errors),
|
error: JSON.stringify(error),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
}
|
}
|
||||||
setLoading(false);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@@ -7,21 +7,31 @@ import { connect } from "react-redux";
|
|||||||
import { useHistory } from "react-router";
|
import { useHistory } from "react-router";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { UPDATE_JOB_LINES_IOU } from "../../graphql/jobs-lines.queries";
|
import { UPDATE_JOB_LINES_IOU } from "../../graphql/jobs-lines.queries";
|
||||||
|
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||||
import {
|
import {
|
||||||
selectBodyshop,
|
selectBodyshop,
|
||||||
selectCurrentUser,
|
selectCurrentUser,
|
||||||
} from "../../redux/user/user.selectors";
|
} from "../../redux/user/user.selectors";
|
||||||
import { CreateIouForJob } from "../jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util";
|
import { CreateIouForJob } from "../jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
|
technician: selectTechnician,
|
||||||
});
|
});
|
||||||
|
|
||||||
const mapDispatchToProps = (dispatch) => ({
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
});
|
});
|
||||||
export default connect(mapStateToProps, mapDispatchToProps)(JobCreateIOU);
|
export default connect(mapStateToProps, mapDispatchToProps)(JobCreateIOU);
|
||||||
|
|
||||||
export function JobCreateIOU({ bodyshop, currentUser, job, selectedJobLines }) {
|
export function JobCreateIOU({
|
||||||
|
bodyshop,
|
||||||
|
currentUser,
|
||||||
|
job,
|
||||||
|
selectedJobLines,
|
||||||
|
technician,
|
||||||
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const client = useApolloClient();
|
const client = useApolloClient();
|
||||||
@@ -79,13 +89,19 @@ export function JobCreateIOU({ bodyshop, currentUser, job, selectedJobLines }) {
|
|||||||
title={t("jobs.labels.createiouwarning")}
|
title={t("jobs.labels.createiouwarning")}
|
||||||
onConfirm={handleCreateIou}
|
onConfirm={handleCreateIou}
|
||||||
disabled={
|
disabled={
|
||||||
!selectedJobLines || selectedJobLines.length === 0 || !job.converted
|
!selectedJobLines ||
|
||||||
|
selectedJobLines.length === 0 ||
|
||||||
|
!job.converted ||
|
||||||
|
technician
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<Button
|
<Button
|
||||||
loading={loading}
|
loading={loading}
|
||||||
disabled={
|
disabled={
|
||||||
!selectedJobLines || selectedJobLines.length === 0 || !job.converted
|
!selectedJobLines ||
|
||||||
|
selectedJobLines.length === 0 ||
|
||||||
|
!job.converted ||
|
||||||
|
technician
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{t("jobs.actions.createiou")}
|
{t("jobs.actions.createiou")}
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
});
|
});
|
||||||
|
|
||||||
const span = {
|
const span = {
|
||||||
sm: { span: 24 },
|
lg: { span: 24 },
|
||||||
md: { span: 12 },
|
xl: { span: 12 },
|
||||||
lg: { span: 8 },
|
xxl: { span: 8 },
|
||||||
};
|
};
|
||||||
|
|
||||||
export function JobDetailCards({ bodyshop, setPrintCenterContext }) {
|
export function JobDetailCards({ bodyshop, setPrintCenterContext }) {
|
||||||
@@ -137,12 +137,6 @@ export function JobDetailCards({ bodyshop, setPrintCenterContext }) {
|
|||||||
data={data ? data.jobs_by_pk : null}
|
data={data ? data.jobs_by_pk : null}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col {...span}>
|
|
||||||
<JobDetailCardsPartsComponent
|
|
||||||
loading={loading}
|
|
||||||
data={data ? data.jobs_by_pk : null}
|
|
||||||
/>
|
|
||||||
</Col>
|
|
||||||
<Col {...span}>
|
<Col {...span}>
|
||||||
<JobDetailCardsNotesComponent
|
<JobDetailCardsNotesComponent
|
||||||
loading={loading}
|
loading={loading}
|
||||||
@@ -163,6 +157,12 @@ export function JobDetailCards({ bodyshop, setPrintCenterContext }) {
|
|||||||
data={data ? data.jobs_by_pk : null}
|
data={data ? data.jobs_by_pk : null}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
|
<JobDetailCardsPartsComponent
|
||||||
|
loading={loading}
|
||||||
|
data={data ? data.jobs_by_pk : null}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Card>
|
</Card>
|
||||||
) : null}
|
) : null}
|
||||||
|
|||||||
@@ -1,16 +1,119 @@
|
|||||||
|
import { Table } from "antd";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import JobLineNotePopup from "../job-line-note-popup/job-line-note-popup.component";
|
||||||
import PartsStatusPie from "../parts-status-pie/parts-status-pie.component";
|
import PartsStatusPie from "../parts-status-pie/parts-status-pie.component";
|
||||||
import CardTemplate from "./job-detail-cards.template.component";
|
import CardTemplate from "./job-detail-cards.template.component";
|
||||||
|
|
||||||
export default function JobDetailCardsPartsComponent({ loading, data }) {
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
|
import { onlyUnique } from "../../utils/arrayHelper";
|
||||||
|
import { alphaSort } from "../../utils/sorters";
|
||||||
|
import JobLineLocationPopup from "../job-line-location-popup/job-line-location-popup.component";
|
||||||
|
import JobLineStatusPopup from "../job-line-status-popup/job-line-status-popup.component";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
//currentUser: selectCurrentUser
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(JobDetailCardsPartsComponent);
|
||||||
|
|
||||||
|
export function JobDetailCardsPartsComponent({ loading, data, jobRO }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { joblines_status } = data;
|
const { joblines_status } = data;
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.line_desc"),
|
||||||
|
dataIndex: "line_desc",
|
||||||
|
fixed: "left",
|
||||||
|
key: "line_desc",
|
||||||
|
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
||||||
|
onCell: (record) => ({
|
||||||
|
className: record.manual_line && "job-line-manual",
|
||||||
|
style: {
|
||||||
|
...(record.critical ? { boxShadow: " -.5em 0 0 #FFC107" } : {}),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
width: "30%",
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.part_type"),
|
||||||
|
dataIndex: "part_type",
|
||||||
|
key: "part_type",
|
||||||
|
width: "15%",
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(
|
||||||
|
t(`joblines.fields.part_types.${a.part_type}`),
|
||||||
|
t(`joblines.fields.part_types.${b.part_type}`)
|
||||||
|
),
|
||||||
|
render: (text, record) =>
|
||||||
|
record.part_type
|
||||||
|
? t(`joblines.fields.part_types.${record.part_type}`)
|
||||||
|
: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.part_qty"),
|
||||||
|
dataIndex: "part_qty",
|
||||||
|
key: "part_qty",
|
||||||
|
width: "10%",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.notes"),
|
||||||
|
dataIndex: "notes",
|
||||||
|
key: "notes",
|
||||||
|
render: (text, record) => (
|
||||||
|
<JobLineNotePopup disabled={jobRO} jobline={record} />
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.location"),
|
||||||
|
dataIndex: "location",
|
||||||
|
key: "location",
|
||||||
|
sorter: (a, b) => alphaSort(a.location, b.location),
|
||||||
|
render: (text, record) => (
|
||||||
|
<JobLineLocationPopup jobline={record} disabled={jobRO} />
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.status"),
|
||||||
|
dataIndex: "status",
|
||||||
|
key: "status",
|
||||||
|
sorter: (a, b) => alphaSort(a.status, b.status),
|
||||||
|
filters:
|
||||||
|
(data &&
|
||||||
|
data.joblines
|
||||||
|
?.map((l) => l.status)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Status*",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.status),
|
||||||
|
render: (text, record) => (
|
||||||
|
<JobLineStatusPopup jobline={record} disabled={jobRO} />
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<CardTemplate loading={loading} title={t("jobs.labels.cards.parts")}>
|
<CardTemplate loading={loading} title={t("jobs.labels.cards.parts")}>
|
||||||
<PartsStatusPie joblines_status={joblines_status} />
|
<PartsStatusPie joblines_status={joblines_status} />
|
||||||
|
<Table
|
||||||
|
key="id"
|
||||||
|
columns={columns}
|
||||||
|
dataSource={data ? data.joblines : []}
|
||||||
|
/>
|
||||||
</CardTemplate>
|
</CardTemplate>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -1,15 +1,37 @@
|
|||||||
import React from "react";
|
|
||||||
import { Card } from "antd";
|
import { Card } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||||
|
|
||||||
export default function JobDetailCardTemplate({
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
technician: selectTechnician,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(JobDetailCardTemplate);
|
||||||
|
|
||||||
|
export function JobDetailCardTemplate({
|
||||||
loading,
|
loading,
|
||||||
title,
|
title,
|
||||||
extraLink,
|
extraLink,
|
||||||
|
technician,
|
||||||
...otherProps
|
...otherProps
|
||||||
}) {
|
}) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
let extra;
|
let extra;
|
||||||
if (extraLink) extra = { extra: <Link to={extraLink}>More</Link> };
|
if (extraLink && !technician)
|
||||||
|
extra = {
|
||||||
|
extra: <Link to={extraLink}>{t("jobs.labels.cards.more")}</Link>,
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<Card
|
<Card
|
||||||
size="small"
|
size="small"
|
||||||
|
|||||||
@@ -8,7 +8,18 @@ import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
|||||||
import { DateFormatter } from "../../utils/DateFormatter";
|
import { DateFormatter } from "../../utils/DateFormatter";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
|
||||||
export default function JobLinesExpander({ jobline, jobid }) {
|
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)(JobLinesExpander);
|
||||||
|
|
||||||
|
export function JobLinesExpander({ jobline, jobid, bodyshop }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const { loading, error, data } = useQuery(GET_JOB_LINE_ORDERS, {
|
const { loading, error, data } = useQuery(GET_JOB_LINE_ORDERS, {
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
@@ -23,7 +34,7 @@ export default function JobLinesExpander({ jobline, jobid }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Row>
|
<Row>
|
||||||
<Col md={24} lg={12}>
|
<Col md={24} lg={8}>
|
||||||
<Typography.Title level={4}>
|
<Typography.Title level={4}>
|
||||||
{t("parts_orders.labels.parts_orders")}
|
{t("parts_orders.labels.parts_orders")}
|
||||||
</Typography.Title>
|
</Typography.Title>
|
||||||
@@ -49,7 +60,7 @@ export default function JobLinesExpander({ jobline, jobid }) {
|
|||||||
)}
|
)}
|
||||||
</Timeline>
|
</Timeline>
|
||||||
</Col>
|
</Col>
|
||||||
<Col md={24} lg={12}>
|
<Col md={24} lg={8}>
|
||||||
<Typography.Title level={4}>{t("bills.labels.bills")}</Typography.Title>
|
<Typography.Title level={4}>{t("bills.labels.bills")}</Typography.Title>
|
||||||
<Timeline>
|
<Timeline>
|
||||||
{data.billlines.length > 0 ? (
|
{data.billlines.length > 0 ? (
|
||||||
@@ -71,7 +82,7 @@ export default function JobLinesExpander({ jobline, jobid }) {
|
|||||||
</Col>
|
</Col>
|
||||||
<Col span={4}>
|
<Col span={4}>
|
||||||
<span>
|
<span>
|
||||||
{`${t("billlines.fields.actual_cost")}: `}
|
{`${t("billlines.fields.actual_cost")}: `}
|
||||||
<CurrencyFormatter>{line.actual_cost}</CurrencyFormatter>
|
<CurrencyFormatter>{line.actual_cost}</CurrencyFormatter>
|
||||||
</span>
|
</span>
|
||||||
</Col>
|
</Col>
|
||||||
@@ -89,6 +100,37 @@ export default function JobLinesExpander({ jobline, jobid }) {
|
|||||||
)}
|
)}
|
||||||
</Timeline>
|
</Timeline>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col md={24} lg={8}>
|
||||||
|
<Typography.Title level={4}>
|
||||||
|
{t("parts_dispatch.labels.parts_dispatch")}
|
||||||
|
</Typography.Title>
|
||||||
|
<Timeline>
|
||||||
|
{data.parts_dispatch_lines.length > 0 ? (
|
||||||
|
data.parts_dispatch_lines.map((line) => (
|
||||||
|
<Timeline.Item key={line.id}>
|
||||||
|
<Space split={<Divider type="vertical" />} wrap>
|
||||||
|
<Link to={`/manage/jobs/${jobid}?partsorderid=${line.id}`}>
|
||||||
|
{line.parts_dispatch.number}
|
||||||
|
</Link>
|
||||||
|
{
|
||||||
|
bodyshop.employees.find(
|
||||||
|
(e) => e.id === line.parts_dispatch.employeeid
|
||||||
|
)?.first_name
|
||||||
|
}
|
||||||
|
<Space>
|
||||||
|
{t("parts_dispatch_lines.fields.accepted_at")}
|
||||||
|
<DateFormatter>{line.accepted_at}</DateFormatter>
|
||||||
|
</Space>
|
||||||
|
</Space>
|
||||||
|
</Timeline.Item>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<Timeline.Item>
|
||||||
|
{t("parts_orders.labels.notyetordered")}
|
||||||
|
</Timeline.Item>
|
||||||
|
)}
|
||||||
|
</Timeline>
|
||||||
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,97 @@
|
|||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Button, Form, notification, Popover, Tooltip } from "antd";
|
||||||
|
import { t } from "i18next";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { UPDATE_LINE_PPC } from "../../graphql/jobs-lines.queries";
|
||||||
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
|
import CurrencyFormItemComponent from "../form-items-formatted/currency-form-item.component";
|
||||||
|
import JobLineConvertToLabor from "../job-line-convert-to-labor/job-line-convert-to-labor.component";
|
||||||
|
import axios from "axios";
|
||||||
|
export default function JobLinesPartPriceChange({ job, line, refetch }) {
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [updatePartPrice] = useMutation(UPDATE_LINE_PPC);
|
||||||
|
|
||||||
|
const handleFinish = async (values) => {
|
||||||
|
try {
|
||||||
|
setLoading(true);
|
||||||
|
const result = await updatePartPrice({
|
||||||
|
variables: {
|
||||||
|
id: line.id,
|
||||||
|
jobline: {
|
||||||
|
act_price_before_ppc: line.act_price_before_ppc
|
||||||
|
? line.act_price_before_ppc
|
||||||
|
: line.act_price,
|
||||||
|
act_price: values.act_price,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
await axios.post("/job/totalsssu", {
|
||||||
|
id: job.id,
|
||||||
|
});
|
||||||
|
if (result.errors) {
|
||||||
|
notification.open({
|
||||||
|
type: "error",
|
||||||
|
message: t("joblines.errors.saving", {
|
||||||
|
error: JSON.stringify(result.errors),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
if (refetch) refetch();
|
||||||
|
} else {
|
||||||
|
notification.open({
|
||||||
|
type: "success",
|
||||||
|
message: t("joblines.successes.saved"),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
notification.open({
|
||||||
|
type: "error",
|
||||||
|
message: t("joblines.errors.saving", { error: JSON.stringify(error) }),
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const popcontent = (
|
||||||
|
<Form layout="vertical" onFinish={handleFinish} initialValues={{ act_price: line.act_price }}>
|
||||||
|
<Form.Item
|
||||||
|
name="act_price"
|
||||||
|
label={t("jobs.labels.act_price_ppc")}
|
||||||
|
rules={[{ required: true }]}
|
||||||
|
>
|
||||||
|
<CurrencyFormItemComponent />
|
||||||
|
</Form.Item>
|
||||||
|
<Button loading={loading} htmlType="primary">
|
||||||
|
{t("general.actions.save")}
|
||||||
|
</Button>
|
||||||
|
</Form>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<JobLineConvertToLabor jobline={line} job={job}>
|
||||||
|
<Popover trigger="click" disabled={line.manual_line} content={popcontent}>
|
||||||
|
<CurrencyFormatter>
|
||||||
|
{line.db_ref === "900510" || line.db_ref === "900511"
|
||||||
|
? line.prt_dsmk_m
|
||||||
|
: line.act_price}
|
||||||
|
</CurrencyFormatter>
|
||||||
|
{line.prt_dsmk_p && line.prt_dsmk_p !== 0 ? (
|
||||||
|
<span style={{ marginLeft: ".2rem" }}>{`(${line.prt_dsmk_p}%)`}</span>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
|
{line.act_price_before_ppc && line.act_price_before_ppc !== 0 ? (
|
||||||
|
<Tooltip title={t("jobs.labels.ppc")}>
|
||||||
|
<span style={{ marginLeft: ".2rem", color: "tomato" }}>
|
||||||
|
(
|
||||||
|
<CurrencyFormatter>{line.act_price_before_ppc}</CurrencyFormatter>
|
||||||
|
)
|
||||||
|
</span>
|
||||||
|
</Tooltip>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
|
</Popover>
|
||||||
|
</JobLineConvertToLabor>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,12 +1,12 @@
|
|||||||
import {
|
import {
|
||||||
DeleteFilled,
|
DeleteFilled,
|
||||||
|
EditFilled,
|
||||||
FilterFilled,
|
FilterFilled,
|
||||||
|
HomeOutlined,
|
||||||
|
MinusCircleTwoTone,
|
||||||
|
PlusCircleTwoTone,
|
||||||
SyncOutlined,
|
SyncOutlined,
|
||||||
WarningFilled,
|
WarningFilled,
|
||||||
EditFilled,
|
|
||||||
PlusCircleTwoTone,
|
|
||||||
MinusCircleTwoTone,
|
|
||||||
HomeOutlined,
|
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import {
|
import {
|
||||||
@@ -29,7 +29,6 @@ import { selectJobReadOnly } from "../../redux/application/application.selectors
|
|||||||
import { setModalContext } from "../../redux/modals/modals.actions";
|
import { setModalContext } from "../../redux/modals/modals.actions";
|
||||||
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||||
import { onlyUnique } from "../../utils/arrayHelper";
|
import { onlyUnique } from "../../utils/arrayHelper";
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { alphaSort } from "../../utils/sorters";
|
||||||
import JobLineLocationPopup from "../job-line-location-popup/job-line-location-popup.component";
|
import JobLineLocationPopup from "../job-line-location-popup/job-line-location-popup.component";
|
||||||
import JobLineNotePopup from "../job-line-note-popup/job-line-note-popup.component";
|
import JobLineNotePopup from "../job-line-note-popup/job-line-note-popup.component";
|
||||||
@@ -38,13 +37,18 @@ import JobLinesBillRefernece from "../job-lines-bill-reference/job-lines-bill-re
|
|||||||
// import AllocationsAssignmentContainer from "../allocations-assignment/allocations-assignment.container";
|
// import AllocationsAssignmentContainer from "../allocations-assignment/allocations-assignment.container";
|
||||||
// import AllocationsBulkAssignmentContainer from "../allocations-bulk-assignment/allocations-bulk-assignment.container";
|
// import AllocationsBulkAssignmentContainer from "../allocations-bulk-assignment/allocations-bulk-assignment.container";
|
||||||
// import AllocationsEmployeeLabelContainer from "../allocations-employee-label/allocations-employee-label.container";
|
// import AllocationsEmployeeLabelContainer from "../allocations-employee-label/allocations-employee-label.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 JobLinesExpander from "./job-lines-expander.component";
|
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import JobLineConvertToLabor from "../job-line-convert-to-labor/job-line-convert-to-labor.component";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import JobCreateIOU from "../job-create-iou/job-create-iou.component";
|
||||||
|
import JobSendPartPriceChangeComponent from "../job-send-parts-price-change/job-send-parts-price-change.component";
|
||||||
|
import PartsOrderModalContainer from "../parts-order-modal/parts-order-modal.container";
|
||||||
|
import JobLinesExpander from "./job-lines-expander.component";
|
||||||
|
import JobLinesPartPriceChange from "./job-lines-part-price-change.component";
|
||||||
|
import JoblineTeamAssignment from "../job-line-team-assignment/job-line-team-assignmnent.component";
|
||||||
|
import JobLineDispatchButton from "../job-line-dispatch-button/job-line-dispatch-button.component";
|
||||||
|
import JobLineBulkAssignComponent from "../job-line-bulk-assign/job-line-bulk-assign.component";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -76,8 +80,16 @@ export function JobLinesComponent({
|
|||||||
setBillEnterContext,
|
setBillEnterContext,
|
||||||
}) {
|
}) {
|
||||||
const [deleteJobLine] = useMutation(DELETE_JOB_LINE_BY_PK);
|
const [deleteJobLine] = useMutation(DELETE_JOB_LINE_BY_PK);
|
||||||
|
const { Enhanced_Payroll } = useTreatments(
|
||||||
|
["Enhanced_Payroll"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
const [selectedLines, setSelectedLines] = useState([]);
|
const [selectedLines, setSelectedLines] = useState([]);
|
||||||
|
console.log(
|
||||||
|
"🚀 ~ file: job-lines.component.jsx:89 ~ selectedLines:",
|
||||||
|
selectedLines
|
||||||
|
);
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
sortedInfo: {},
|
sortedInfo: {},
|
||||||
filteredInfo: {},
|
filteredInfo: {},
|
||||||
@@ -121,10 +133,21 @@ export function JobLinesComponent({
|
|||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "oem_partno" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "oem_partno" && state.sortedInfo.order,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (text, record) =>
|
onCell: (record) => ({
|
||||||
`${record.oem_partno || ""} ${
|
className: record.manual_line && "job-line-manual",
|
||||||
record.alt_partno ? `(${record.alt_partno})` : ""
|
style: {
|
||||||
}`.trim(),
|
...(record.parts_dispatch_lines[0]?.accepted_at
|
||||||
|
? { boxShadow: " -.5em 0 0 #FFC107" }
|
||||||
|
: {}),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
render: (text, record) => (
|
||||||
|
<span class="ant-table-cell-content">
|
||||||
|
{`${record.oem_partno || ""} ${
|
||||||
|
record.alt_partno ? `(${record.alt_partno})` : ""
|
||||||
|
}`.trim()}
|
||||||
|
</span>
|
||||||
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("joblines.fields.op_code_desc"),
|
title: t("joblines.fields.op_code_desc"),
|
||||||
@@ -220,20 +243,7 @@ export function JobLinesComponent({
|
|||||||
state.sortedInfo.columnKey === "act_price" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "act_price" && state.sortedInfo.order,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<JobLineConvertToLabor jobline={record} job={job}>
|
<JobLinesPartPriceChange line={record} job={job} refetch={refetch} />
|
||||||
<CurrencyFormatter>
|
|
||||||
{record.db_ref === "900510" || record.db_ref === "900511"
|
|
||||||
? record.prt_dsmk_m
|
|
||||||
: record.act_price}
|
|
||||||
</CurrencyFormatter>
|
|
||||||
{record.prt_dsmk_p && record.prt_dsmk_p !== 0 ? (
|
|
||||||
<span
|
|
||||||
style={{ marginLeft: ".2rem" }}
|
|
||||||
>{`(${record.prt_dsmk_p}%)`}</span>
|
|
||||||
) : (
|
|
||||||
<></>
|
|
||||||
)}
|
|
||||||
</JobLineConvertToLabor>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -286,6 +296,23 @@ export function JobLinesComponent({
|
|||||||
state.sortedInfo.columnKey === "line_ind" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "line_ind" && state.sortedInfo.order,
|
||||||
responsive: ["md"],
|
responsive: ["md"],
|
||||||
},
|
},
|
||||||
|
...(Enhanced_Payroll.treatment === "on"
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.assigned_team"),
|
||||||
|
dataIndex: "assigned_team",
|
||||||
|
key: "assigned_team",
|
||||||
|
render: (text, record) => (
|
||||||
|
<JoblineTeamAssignment
|
||||||
|
disabled={jobRO}
|
||||||
|
jobline={record}
|
||||||
|
jobId={job.id}
|
||||||
|
/>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: []),
|
||||||
|
|
||||||
{
|
{
|
||||||
title: t("joblines.fields.notes"),
|
title: t("joblines.fields.notes"),
|
||||||
dataIndex: "notes",
|
dataIndex: "notes",
|
||||||
@@ -404,7 +431,11 @@ export function JobLinesComponent({
|
|||||||
setSelectedLines((selectedLines) =>
|
setSelectedLines((selectedLines) =>
|
||||||
_.uniq([
|
_.uniq([
|
||||||
...selectedLines,
|
...selectedLines,
|
||||||
...jobLines.filter((item) => markedTypes.includes(item.part_type)),
|
...jobLines.filter(
|
||||||
|
(item) =>
|
||||||
|
markedTypes.includes(item.part_type) ||
|
||||||
|
markedTypes.includes(item.mod_lbr_ty)
|
||||||
|
),
|
||||||
])
|
])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -417,6 +448,21 @@ export function JobLinesComponent({
|
|||||||
<Menu.Item key="PAL">{t("joblines.fields.part_types.PAL")}</Menu.Item>
|
<Menu.Item key="PAL">{t("joblines.fields.part_types.PAL")}</Menu.Item>
|
||||||
<Menu.Item key="PAS">{t("joblines.fields.part_types.PAS")}</Menu.Item>
|
<Menu.Item key="PAS">{t("joblines.fields.part_types.PAS")}</Menu.Item>
|
||||||
<Menu.Divider />
|
<Menu.Divider />
|
||||||
|
<Menu.Item key="LAA">{t("joblines.fields.lbr_types.LAA")}</Menu.Item>
|
||||||
|
<Menu.Item key="LAB">{t("joblines.fields.lbr_types.LAB")}</Menu.Item>
|
||||||
|
<Menu.Item key="LAD">{t("joblines.fields.lbr_types.LAD")}</Menu.Item>
|
||||||
|
<Menu.Item key="LAE">{t("joblines.fields.lbr_types.LAE")}</Menu.Item>
|
||||||
|
<Menu.Item key="LAF">{t("joblines.fields.lbr_types.LAF")}</Menu.Item>
|
||||||
|
<Menu.Item key="LAG">{t("joblines.fields.lbr_types.LAG")}</Menu.Item>
|
||||||
|
<Menu.Item key="LAM">{t("joblines.fields.lbr_types.LAM")}</Menu.Item>
|
||||||
|
<Menu.Item key="LAR">{t("joblines.fields.lbr_types.LAR")}</Menu.Item>
|
||||||
|
<Menu.Item key="LAS">{t("joblines.fields.lbr_types.LAS")}</Menu.Item>
|
||||||
|
<Menu.Item key="LAU">{t("joblines.fields.lbr_types.LAU")}</Menu.Item>
|
||||||
|
<Menu.Item key="LA1">{t("joblines.fields.lbr_types.LA1")}</Menu.Item>
|
||||||
|
<Menu.Item key="LA2">{t("joblines.fields.lbr_types.LA2")}</Menu.Item>
|
||||||
|
<Menu.Item key="LA3">{t("joblines.fields.lbr_types.LA3")}</Menu.Item>
|
||||||
|
<Menu.Item key="LA4">{t("joblines.fields.lbr_types.LA2")}</Menu.Item>
|
||||||
|
<Menu.Divider />
|
||||||
<Menu.Item key="clear">{t("general.labels.clear")}</Menu.Item>
|
<Menu.Item key="clear">{t("general.labels.clear")}</Menu.Item>
|
||||||
</Menu>
|
</Menu>
|
||||||
);
|
);
|
||||||
@@ -440,6 +486,18 @@ export function JobLinesComponent({
|
|||||||
</Space>
|
</Space>
|
||||||
</Tag>
|
</Tag>
|
||||||
)}
|
)}
|
||||||
|
<JobLineDispatchButton
|
||||||
|
selectedLines={selectedLines}
|
||||||
|
setSelectedLines={setSelectedLines}
|
||||||
|
job={job}
|
||||||
|
/>
|
||||||
|
{Enhanced_Payroll.treatment === "on" && (
|
||||||
|
<JobLineBulkAssignComponent
|
||||||
|
selectedLines={selectedLines}
|
||||||
|
setSelectedLines={setSelectedLines}
|
||||||
|
job={job}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
disabled={
|
disabled={
|
||||||
(job && !job.converted) ||
|
(job && !job.converted) ||
|
||||||
@@ -448,15 +506,6 @@ export function JobLinesComponent({
|
|||||||
technician
|
technician
|
||||||
}
|
}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
// setPartsOrderContext({
|
|
||||||
// actions: { refetch: refetch },
|
|
||||||
// context: {
|
|
||||||
// jobId: job.id,
|
|
||||||
// job: job,
|
|
||||||
// linesToOrder: selectedLines,
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
|
|
||||||
setBillEnterContext({
|
setBillEnterContext({
|
||||||
actions: { refetch: refetch },
|
actions: { refetch: refetch },
|
||||||
context: {
|
context: {
|
||||||
@@ -563,6 +612,9 @@ export function JobLinesComponent({
|
|||||||
>
|
>
|
||||||
{t("joblines.actions.new")}
|
{t("joblines.actions.new")}
|
||||||
</Button>
|
</Button>
|
||||||
|
{bodyshop.region_config.toLowerCase().startsWith("us") && (
|
||||||
|
<JobSendPartPriceChangeComponent job={job} />
|
||||||
|
)}
|
||||||
<JobCreateIOU job={job} selectedJobLines={selectedLines} />
|
<JobCreateIOU job={job} selectedJobLines={selectedLines} />
|
||||||
<Input.Search
|
<Input.Search
|
||||||
placeholder={t("general.labels.search")}
|
placeholder={t("general.labels.search")}
|
||||||
|
|||||||
246
client/src/components/job-lifecycle/job-lifecycle.component.jsx
Normal file
246
client/src/components/job-lifecycle/job-lifecycle.component.jsx
Normal file
@@ -0,0 +1,246 @@
|
|||||||
|
import React, {useCallback, useEffect, useState} from 'react';
|
||||||
|
import moment from "moment";
|
||||||
|
import axios from 'axios';
|
||||||
|
import {Badge, Card, Space, Table, Tag} from 'antd';
|
||||||
|
import {gql, useQuery} from "@apollo/client";
|
||||||
|
import {DateTimeFormatterFunction} from "../../utils/DateFormatter";
|
||||||
|
import {isEmpty} from "lodash";
|
||||||
|
import {useTranslation} from "react-i18next";
|
||||||
|
|
||||||
|
require('./job-lifecycle.styles.scss');
|
||||||
|
|
||||||
|
// show text on bar if text can fit
|
||||||
|
export function JobLifecycleComponent({job, statuses, ...rest}) {
|
||||||
|
const [loading, setLoading] = useState(true);
|
||||||
|
const [lifecycleData, setLifecycleData] = useState(null);
|
||||||
|
const {t} = useTranslation(); // Used for tracking external state changes.
|
||||||
|
|
||||||
|
const {data} = useQuery(gql`
|
||||||
|
query get_job_test($id: uuid!){
|
||||||
|
jobs_by_pk(id:$id){
|
||||||
|
id
|
||||||
|
status
|
||||||
|
}
|
||||||
|
}
|
||||||
|
`, {
|
||||||
|
variables: {
|
||||||
|
id: job.id
|
||||||
|
},
|
||||||
|
fetchPolicy: 'cache-only'
|
||||||
|
});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the lifecycle data for the job.
|
||||||
|
* @returns {Promise<void>}
|
||||||
|
*/
|
||||||
|
const getLifecycleData = useCallback(async () => {
|
||||||
|
if (job && job.id && statuses && statuses.statuses) {
|
||||||
|
try {
|
||||||
|
setLoading(true);
|
||||||
|
const response = await axios.post("/job/lifecycle", {
|
||||||
|
jobids: job.id,
|
||||||
|
statuses: statuses.statuses
|
||||||
|
});
|
||||||
|
const data = response.data.transition[job.id];
|
||||||
|
setLifecycleData(data);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(`${t('job_lifecycle.errors.fetch')}: ${err.message}`);
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [job, statuses, t]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (!data) return;
|
||||||
|
setTimeout(() => {
|
||||||
|
getLifecycleData().catch(err => console.error(`${t('job_lifecycle.errors.fetch')}: ${err.message}`));
|
||||||
|
}, 500);
|
||||||
|
}, [data, getLifecycleData, t]);
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t('job_lifecycle.columns.value'),
|
||||||
|
dataIndex: 'value',
|
||||||
|
key: 'value',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('job_lifecycle.columns.start'),
|
||||||
|
dataIndex: 'start',
|
||||||
|
key: 'start',
|
||||||
|
render: (text) => DateTimeFormatterFunction(text),
|
||||||
|
sorter: (a, b) => moment(a.start).unix() - moment(b.start).unix(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('job_lifecycle.columns.relative_start'),
|
||||||
|
dataIndex: 'start_readable',
|
||||||
|
key: 'start_readable',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('job_lifecycle.columns.end'),
|
||||||
|
dataIndex: 'end',
|
||||||
|
key: 'end',
|
||||||
|
sorter: (a, b) => {
|
||||||
|
if (isEmpty(a.end) || isEmpty(b.end)) {
|
||||||
|
if (isEmpty(a.end) && isEmpty(b.end)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return isEmpty(a.end) ? 1 : -1;
|
||||||
|
}
|
||||||
|
return moment(a.end).unix() - moment(b.end).unix();
|
||||||
|
},
|
||||||
|
render: (text) => isEmpty(text) ? t('job_lifecycle.content.not_available') : DateTimeFormatterFunction(text)
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('job_lifecycle.columns.relative_end'),
|
||||||
|
dataIndex: 'end_readable',
|
||||||
|
key: 'end_readable',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t('job_lifecycle.columns.duration'),
|
||||||
|
dataIndex: 'duration_readable',
|
||||||
|
key: 'duration_readable',
|
||||||
|
sorter: (a, b) => a.duration - b.duration,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card loading={loading} title={t('job_lifecycle.content.title')}>
|
||||||
|
{!loading ? (
|
||||||
|
lifecycleData && lifecycleData.lifecycle && lifecycleData.durations ? (
|
||||||
|
<Space direction='vertical' style={{width: '100%'}}>
|
||||||
|
<Card
|
||||||
|
type='inner'
|
||||||
|
title={(
|
||||||
|
<Space direction='horizontal' size='small'>
|
||||||
|
<Badge status='processing' count={lifecycleData.durations.totalStatuses}/>
|
||||||
|
{t('job_lifecycle.content.title_durations')}
|
||||||
|
</Space>
|
||||||
|
|
||||||
|
)}
|
||||||
|
style={{width: '100%'}}
|
||||||
|
>
|
||||||
|
<div id="bar-container" style={{
|
||||||
|
display: 'flex',
|
||||||
|
width: '100%',
|
||||||
|
height: '100px',
|
||||||
|
textAlign: 'center',
|
||||||
|
borderRadius: '5px',
|
||||||
|
borderWidth: '5px',
|
||||||
|
borderStyle: 'solid',
|
||||||
|
borderColor: '#f0f2f5',
|
||||||
|
margin: 0,
|
||||||
|
padding: 0
|
||||||
|
}}>
|
||||||
|
{lifecycleData.durations.summations.map((key, index, array) => {
|
||||||
|
const isFirst = index === 0;
|
||||||
|
const isLast = index === array.length - 1;
|
||||||
|
return (
|
||||||
|
<div key={key.status} style={{
|
||||||
|
overflow: 'hidden',
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
justifyContent: 'center',
|
||||||
|
alignItems: 'center',
|
||||||
|
margin: 0,
|
||||||
|
padding: 0,
|
||||||
|
|
||||||
|
borderTop: '1px solid #f0f2f5',
|
||||||
|
borderBottom: '1px solid #f0f2f5',
|
||||||
|
borderLeft: isFirst ? '1px solid #f0f2f5' : undefined,
|
||||||
|
borderRight: isLast ? '1px solid #f0f2f5' : undefined,
|
||||||
|
|
||||||
|
backgroundColor: key.color,
|
||||||
|
width: `${key.percentage}%`
|
||||||
|
}}
|
||||||
|
aria-label={`${key.status} | ${key.roundedPercentage} | ${key.humanReadable}`}
|
||||||
|
title={`${key.status} | ${key.roundedPercentage} | ${key.humanReadable}`}
|
||||||
|
>
|
||||||
|
|
||||||
|
{key.percentage > 15 ?
|
||||||
|
<>
|
||||||
|
<div>{key.roundedPercentage}</div>
|
||||||
|
<div style={{
|
||||||
|
backgroundColor: '#f0f2f5',
|
||||||
|
borderRadius: '5px',
|
||||||
|
paddingRight: '2px',
|
||||||
|
paddingLeft: '2px',
|
||||||
|
fontSize: '0.8rem',
|
||||||
|
}}>
|
||||||
|
{key.status}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
: null}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
})}
|
||||||
|
</div>
|
||||||
|
<Card type='inner' title={t('job_lifecycle.content.legend_title')}
|
||||||
|
style={{marginTop: '10px'}}>
|
||||||
|
<div>
|
||||||
|
{lifecycleData.durations.summations.map((key) => (
|
||||||
|
<Tag color={key.color} style={{width: '13vh', padding: '4px', margin: '4px'}}>
|
||||||
|
<div
|
||||||
|
aria-label={`${key.status} | ${key.roundedPercentage} | ${key.humanReadable}`}
|
||||||
|
title={`${key.status} | ${key.roundedPercentage} | ${key.humanReadable}`}
|
||||||
|
style={{
|
||||||
|
backgroundColor: '#f0f2f5',
|
||||||
|
color: '#000',
|
||||||
|
padding: '4px',
|
||||||
|
textAlign: 'center'
|
||||||
|
}}>
|
||||||
|
{key.status} ({key.roundedPercentage})
|
||||||
|
</div>
|
||||||
|
</Tag>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</Card>
|
||||||
|
{(lifecycleData?.durations?.humanReadableTotal) ||
|
||||||
|
(lifecycleData.lifecycle[0] && lifecycleData.lifecycle[0].value && lifecycleData?.durations?.totalCurrentStatusDuration?.humanReadable) ?
|
||||||
|
<Card style={{marginTop: '10px'}}>
|
||||||
|
<ul>
|
||||||
|
{lifecycleData.durations && lifecycleData.durations.humanReadableTotal &&
|
||||||
|
<li>
|
||||||
|
<span
|
||||||
|
style={{fontWeight: 'bold'}}>{t('job_lifecycle.content.previous_status_accumulated_time')}:</span> {lifecycleData.durations.humanReadableTotal}
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
{lifecycleData.lifecycle[0] && lifecycleData.lifecycle[0].value && lifecycleData?.durations?.totalCurrentStatusDuration?.humanReadable &&
|
||||||
|
<li>
|
||||||
|
<span
|
||||||
|
style={{fontWeight: 'bold'}}>{t('job_lifecycle.content.current_status_accumulated_time')} ({lifecycleData.lifecycle[0].value}):</span> {lifecycleData.durations.totalCurrentStatusDuration.humanReadable}
|
||||||
|
</li>
|
||||||
|
}
|
||||||
|
</ul>
|
||||||
|
</Card>
|
||||||
|
: null}
|
||||||
|
</Card>
|
||||||
|
<Card type='inner' title={(
|
||||||
|
<>
|
||||||
|
<Space direction="horizontal" size="small">
|
||||||
|
<Badge status='processing' count={lifecycleData.lifecycle.length}/>
|
||||||
|
{t('job_lifecycle.content.title_transitions')}
|
||||||
|
</Space>
|
||||||
|
</>
|
||||||
|
)}>
|
||||||
|
<Table style={{
|
||||||
|
overflow: 'auto',
|
||||||
|
width: '100%',
|
||||||
|
}} columns={columns} dataSource={lifecycleData.lifecycle}/>
|
||||||
|
</Card>
|
||||||
|
</Space>
|
||||||
|
) : (
|
||||||
|
<Card type='inner' style={{textAlign: 'center'}}>
|
||||||
|
{t('job_lifecycle.content.data_unavailable')}
|
||||||
|
</Card>
|
||||||
|
)
|
||||||
|
) : (
|
||||||
|
<Card type='inner' title={t('job_lifecycle.content.title_loading')}>
|
||||||
|
{t('job_lifecycle.content.loading')}
|
||||||
|
</Card>
|
||||||
|
)}
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default JobLifecycleComponent;
|
||||||
@@ -0,0 +1,149 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
|
||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Button, Form, Popover, Select, Space, notification } from "antd";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { UPDATE_LINE_BULK_ASSIGN } from "../../graphql/jobs-lines.queries";
|
||||||
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
|
import {
|
||||||
|
selectBodyshop,
|
||||||
|
selectCurrentUser,
|
||||||
|
} from "../../redux/user/user.selectors";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
currentUser: selectCurrentUser,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
|
});
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(JoblineBulkAssign);
|
||||||
|
|
||||||
|
export function JoblineBulkAssign({
|
||||||
|
setSelectedLines,
|
||||||
|
selectedLines,
|
||||||
|
insertAuditTrail,
|
||||||
|
bodyshop,
|
||||||
|
jobRO,
|
||||||
|
job,
|
||||||
|
currentUser,
|
||||||
|
}) {
|
||||||
|
const [visible, setVisible] = useState(false);
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [assignLines] = useMutation(UPDATE_LINE_BULK_ASSIGN);
|
||||||
|
|
||||||
|
const handleConvert = async (values) => {
|
||||||
|
try {
|
||||||
|
setLoading(true);
|
||||||
|
const result = await assignLines({
|
||||||
|
variables: {
|
||||||
|
jobline: {
|
||||||
|
assigned_team: values.assigned_team,
|
||||||
|
},
|
||||||
|
ids: selectedLines.map((l) => l.id),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (result.errors) {
|
||||||
|
notification.open({
|
||||||
|
type: "error",
|
||||||
|
message: t("parts_dispatch.errors.creating", {
|
||||||
|
error: JSON.stringify(result.errors),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
//Insert the audit trail here.
|
||||||
|
|
||||||
|
const teamName = bodyshop.employee_teams.find(
|
||||||
|
(et) => et.id === values.assigned_team
|
||||||
|
)?.name;
|
||||||
|
|
||||||
|
const hours = selectedLines.reduce(
|
||||||
|
(acc, val) => (acc += val.mod_lb_hrs),
|
||||||
|
0
|
||||||
|
);
|
||||||
|
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: job.id,
|
||||||
|
operation: AuditTrailMapping.assignedlinehours(
|
||||||
|
teamName,
|
||||||
|
hours.toFixed(1)
|
||||||
|
),
|
||||||
|
});
|
||||||
|
setSelectedLines([]);
|
||||||
|
setVisible(false);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
notification.open({
|
||||||
|
type: "error",
|
||||||
|
message: t("parts_dispatch.errors.creating", {
|
||||||
|
error: error,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const popMenu = (
|
||||||
|
<div>
|
||||||
|
<Form layout="vertical" form={form} onFinish={handleConvert}>
|
||||||
|
<Form.Item
|
||||||
|
name={"assigned_team"}
|
||||||
|
label={t("joblines.fields.assigned_team")}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Select
|
||||||
|
showSearch
|
||||||
|
style={{ width: 200 }}
|
||||||
|
optionFilterProp="children"
|
||||||
|
filterOption={(input, option) =>
|
||||||
|
option.props.children
|
||||||
|
.toLowerCase()
|
||||||
|
.indexOf(input.toLowerCase()) >= 0
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{bodyshop.employee_teams.map((team) => (
|
||||||
|
<Select.Option value={team.id} key={team.id} name={team.name}>
|
||||||
|
{team.name}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Space wrap>
|
||||||
|
<Button type="danger" onClick={() => form.submit()} loading={loading}>
|
||||||
|
{t("general.actions.save")}
|
||||||
|
</Button>
|
||||||
|
<Button onClick={() => setVisible(false)}>
|
||||||
|
{t("general.actions.cancel")}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Popover open={visible} content={popMenu}>
|
||||||
|
<Button
|
||||||
|
disabled={selectedLines.length === 0 || jobRO}
|
||||||
|
loading={loading}
|
||||||
|
onClick={() => setVisible(true)}
|
||||||
|
>
|
||||||
|
{t("joblines.actions.assign_team", { count: selectedLines.length })}
|
||||||
|
</Button>
|
||||||
|
</Popover>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
import React, { useState } from "react";
|
||||||
|
|
||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Button, Form, Popover, Select, Space, notification } from "antd";
|
||||||
|
import moment from "moment";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { INSERT_PARTS_DISPATCH } from "../../graphql/parts-dispatch.queries";
|
||||||
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
|
import {
|
||||||
|
selectBodyshop,
|
||||||
|
selectCurrentUser,
|
||||||
|
} from "../../redux/user/user.selectors";
|
||||||
|
import { GenerateDocument } from "../../utils/RenderTemplate";
|
||||||
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
currentUser: selectCurrentUser,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
//setUserLanguage: language => dispatch(setUserLanguage(language))
|
||||||
|
});
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(JobLineDispatchButton);
|
||||||
|
|
||||||
|
export function JobLineDispatchButton({
|
||||||
|
setSelectedLines,
|
||||||
|
selectedLines,
|
||||||
|
|
||||||
|
bodyshop,
|
||||||
|
jobRO,
|
||||||
|
job,
|
||||||
|
currentUser,
|
||||||
|
}) {
|
||||||
|
const [visible, setVisible] = useState(false);
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
const Templates = TemplateList("job_special", {
|
||||||
|
ro_number: job.ro_number,
|
||||||
|
});
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [dispatchLines] = useMutation(INSERT_PARTS_DISPATCH);
|
||||||
|
|
||||||
|
const handleConvert = async (values) => {
|
||||||
|
try {
|
||||||
|
setLoading(true);
|
||||||
|
//THIS HAS NOT YET BEEN TESTED. START BY FINISHING THIS FUNCTION.
|
||||||
|
const result = await dispatchLines({
|
||||||
|
variables: {
|
||||||
|
partsDispatch: {
|
||||||
|
dispatched_at: moment(),
|
||||||
|
employeeid: values.employeeid,
|
||||||
|
jobid: job.id,
|
||||||
|
dispatched_by: currentUser.email,
|
||||||
|
parts_dispatch_lines: {
|
||||||
|
data: selectedLines.map((l) => ({
|
||||||
|
joblineid: l.id,
|
||||||
|
quantity: l.part_qty,
|
||||||
|
})),
|
||||||
|
},
|
||||||
|
},
|
||||||
|
//joblineids: selectedLines.map((l) => l.id),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (result.errors) {
|
||||||
|
notification.open({
|
||||||
|
type: "error",
|
||||||
|
message: t("parts_dispatch.errors.creating", {
|
||||||
|
error: result.errors,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
setSelectedLines([]);
|
||||||
|
await GenerateDocument(
|
||||||
|
{
|
||||||
|
name: Templates.parts_dispatch.key,
|
||||||
|
variables: {
|
||||||
|
id: result.data.insert_parts_dispatch_one.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{},
|
||||||
|
"p"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
setVisible(false);
|
||||||
|
} catch (error) {
|
||||||
|
notification.open({
|
||||||
|
type: "error",
|
||||||
|
message: t("parts_dispatch.errors.creating", {
|
||||||
|
error: error,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const popMenu = (
|
||||||
|
<div>
|
||||||
|
<Form layout="vertical" form={form} onFinish={handleConvert}>
|
||||||
|
<Form.Item
|
||||||
|
name={"employeeid"}
|
||||||
|
label={t("timetickets.fields.employee")}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
>
|
||||||
|
<Select
|
||||||
|
showSearch
|
||||||
|
style={{ width: 200 }}
|
||||||
|
optionFilterProp="children"
|
||||||
|
filterOption={(input, option) =>
|
||||||
|
option.props.children
|
||||||
|
.toLowerCase()
|
||||||
|
.indexOf(input.toLowerCase()) >= 0
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{bodyshop.employees
|
||||||
|
.filter((emp) => emp.active)
|
||||||
|
.map((emp) => (
|
||||||
|
<Select.Option
|
||||||
|
value={emp.id}
|
||||||
|
key={emp.id}
|
||||||
|
name={`${emp.first_name} ${emp.last_name}`}
|
||||||
|
>
|
||||||
|
{`${emp.first_name} ${emp.last_name}`}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Space wrap>
|
||||||
|
<Button
|
||||||
|
type="danger"
|
||||||
|
onClick={() => form.submit()}
|
||||||
|
loading={loading}
|
||||||
|
disabled={selectedLines.length === 0}
|
||||||
|
>
|
||||||
|
{t("general.actions.save")}
|
||||||
|
</Button>
|
||||||
|
<Button onClick={() => setVisible(false)}>
|
||||||
|
{t("general.actions.cancel")}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
</Form>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Popover open={visible} content={popMenu}>
|
||||||
|
<Button
|
||||||
|
disabled={selectedLines.length === 0 || jobRO}
|
||||||
|
loading={loading}
|
||||||
|
onClick={() => setVisible(true)}
|
||||||
|
>
|
||||||
|
{t("joblines.actions.dispatchparts", { count: selectedLines.length })}
|
||||||
|
</Button>
|
||||||
|
</Popover>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { notification, Select } from "antd";
|
import { notification, Select, Space } 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";
|
||||||
@@ -77,7 +77,10 @@ export function JobLineLocationPopup({ bodyshop, jobline, disabled }) {
|
|||||||
style={{ width: "100%", minHeight: "2rem", cursor: "pointer" }}
|
style={{ width: "100%", minHeight: "2rem", cursor: "pointer" }}
|
||||||
onClick={() => !disabled && setEditing(true)}
|
onClick={() => !disabled && setEditing(true)}
|
||||||
>
|
>
|
||||||
{jobline.location}
|
<Space wrap>
|
||||||
|
{jobline.location}
|
||||||
|
{jobline.parts_dispatch_lines?.length > 0 && "-Disp"}
|
||||||
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,115 @@
|
|||||||
|
import { notification, Select } from "antd";
|
||||||
|
import React, { useEffect, useState } from "react";
|
||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
//currentUser: selectCurrentUser
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
|
});
|
||||||
|
|
||||||
|
export function JoblineTeamAssignment({
|
||||||
|
bodyshop,
|
||||||
|
jobline,
|
||||||
|
disabled,
|
||||||
|
jobId,
|
||||||
|
insertAuditTrail,
|
||||||
|
}) {
|
||||||
|
const [editing, setEditing] = useState(false);
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [assignedTeam, setAssignedTeam] = useState(jobline.assigned_team);
|
||||||
|
const [updateJob] = useMutation(UPDATE_JOB_LINE);
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (editing) setAssignedTeam(jobline.assigned_team);
|
||||||
|
}, [editing, jobline.assigned_team]);
|
||||||
|
|
||||||
|
const handleChange = (e) => {
|
||||||
|
setAssignedTeam(e);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleSave = async (e) => {
|
||||||
|
setLoading(true);
|
||||||
|
const result = await updateJob({
|
||||||
|
variables: {
|
||||||
|
lineId: jobline.id,
|
||||||
|
line: { assigned_team: assignedTeam },
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!!!result.errors) {
|
||||||
|
notification["success"]({ message: t("joblines.successes.saved") });
|
||||||
|
//insert the audit trail here.
|
||||||
|
const teamName = bodyshop.employee_teams.find(
|
||||||
|
(et) => et.id === assignedTeam
|
||||||
|
)?.name;
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: jobId,
|
||||||
|
operation: AuditTrailMapping.assignedlinehours(
|
||||||
|
teamName,
|
||||||
|
jobline.mod_lb_hrs
|
||||||
|
),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
notification["error"]({
|
||||||
|
message: t("joblines.errors.saving", {
|
||||||
|
error: JSON.stringify(result.errors),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
|
setEditing(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
if (editing)
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<LoadingSpinner loading={loading}>
|
||||||
|
<Select
|
||||||
|
autoFocus
|
||||||
|
allowClear
|
||||||
|
dropdownMatchSelectWidth={100}
|
||||||
|
value={assignedTeam}
|
||||||
|
onSelect={handleChange}
|
||||||
|
onBlur={handleSave}
|
||||||
|
onClear={() => handleChange(null)}
|
||||||
|
>
|
||||||
|
{Object.values(bodyshop.employee_teams).map((s, idx) => (
|
||||||
|
<Select.Option key={idx} value={s.id}>
|
||||||
|
{s.name}
|
||||||
|
</Select.Option>
|
||||||
|
))}
|
||||||
|
</Select>
|
||||||
|
</LoadingSpinner>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
|
||||||
|
const team = bodyshop.employee_teams.find(
|
||||||
|
(tm) => tm.id === jobline.assigned_team
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div
|
||||||
|
style={{ width: "100%", minHeight: "1rem", cursor: "pointer" }}
|
||||||
|
onClick={() => !disabled && setEditing(true)}
|
||||||
|
>
|
||||||
|
{team?.name}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(JoblineTeamAssignment);
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
import { Alert } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
export default function JobProfileDataWarning({ job }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
let missingProfileInfo =
|
||||||
|
Object.keys(job.cieca_pft).length === 0 ||
|
||||||
|
Object.keys(job.cieca_pfl).length === 0 ||
|
||||||
|
Object.keys(job.materials).length === 0;
|
||||||
|
|
||||||
|
if (missingProfileInfo)
|
||||||
|
return (
|
||||||
|
<Alert type="error" message={t("jobs.labels.missingprofileinfo")}></Alert>
|
||||||
|
);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
@@ -19,7 +19,8 @@ export default function JobReconciliationModalComponent({ job, bills }) {
|
|||||||
|
|
||||||
const jobLineData = job.joblines.filter(
|
const jobLineData = job.joblines.filter(
|
||||||
(j) =>
|
(j) =>
|
||||||
(j.part_type !== null && j.part_type !== "PAE") ||
|
(j.part_type !== "PAE" && j.act_price !== 0 && j.part_qty !== 0) ||
|
||||||
|
j.misc_amt !== 0 ||
|
||||||
(j.line_desc &&
|
(j.line_desc &&
|
||||||
j.line_desc.toLowerCase().includes("towing") &&
|
j.line_desc.toLowerCase().includes("towing") &&
|
||||||
j.lbr_op === "OP13") ||
|
j.lbr_op === "OP13") ||
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import { useMutation, useLazyQuery } from "@apollo/client";
|
|
||||||
import { CheckCircleOutlined } from "@ant-design/icons";
|
import { CheckCircleOutlined } from "@ant-design/icons";
|
||||||
|
import { useLazyQuery, useMutation } from "@apollo/client";
|
||||||
import {
|
import {
|
||||||
Button,
|
Button,
|
||||||
Card,
|
Card,
|
||||||
Form,
|
Form,
|
||||||
InputNumber,
|
InputNumber,
|
||||||
notification,
|
|
||||||
Popover,
|
Popover,
|
||||||
Space,
|
Space,
|
||||||
|
notification,
|
||||||
} from "antd";
|
} from "antd";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { logImEXEvent } from "../../firebase/firebase.utils";
|
import { logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import {
|
import {
|
||||||
@@ -50,6 +50,7 @@ export default function ScoreboardAddButton({
|
|||||||
|
|
||||||
const handleFinish = async (values) => {
|
const handleFinish = async (values) => {
|
||||||
logImEXEvent("job_close_add_to_scoreboard");
|
logImEXEvent("job_close_add_to_scoreboard");
|
||||||
|
values.date = moment(values.date).format("YYYY-MM-DD");
|
||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
let result;
|
let result;
|
||||||
@@ -177,7 +178,7 @@ export default function ScoreboardAddButton({
|
|||||||
return acc + job.lbr_adjustments[val];
|
return acc + job.lbr_adjustments[val];
|
||||||
}, 0);
|
}, 0);
|
||||||
form.setFieldsValue({
|
form.setFieldsValue({
|
||||||
date: new moment(),
|
date: moment(),
|
||||||
bodyhrs: Math.round(v.bodyhrs * 10) / 10,
|
bodyhrs: Math.round(v.bodyhrs * 10) / 10,
|
||||||
painthrs: Math.round(v.painthrs * 10) / 10,
|
painthrs: Math.round(v.painthrs * 10) / 10,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,31 @@
|
|||||||
|
import { Button, notification } from "antd";
|
||||||
|
import axios from "axios";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
export default function JobSendPartPriceChangeComponent({ job }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const handleClick = async () => {
|
||||||
|
setLoading(true);
|
||||||
|
try {
|
||||||
|
const ppcData = await axios.post("/job/ppc", { jobid: job.id });
|
||||||
|
await axios.post("http://localhost:1337/ppc/", ppcData.data);
|
||||||
|
} catch (error) {
|
||||||
|
notification.open({
|
||||||
|
type: "error",
|
||||||
|
message: t("jobs.errors.partspricechange", {
|
||||||
|
error: JSON.stringify(error),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
} finally {
|
||||||
|
setLoading(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Button onClick={handleClick} loading={loading}>
|
||||||
|
{t("jobs.actions.sendpartspricechange")}
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -67,7 +67,8 @@ export function JobsTotalsTableComponent({ jobRO, currentUser, job }) {
|
|||||||
<JobTotalsTableTotals job={job} />
|
<JobTotalsTableTotals job={job} />
|
||||||
</Card>
|
</Card>
|
||||||
</Col>
|
</Col>
|
||||||
{currentUser.email.includes("@imex.") && (
|
{(currentUser.email.includes("@imex.") ||
|
||||||
|
currentUser.email.includes("@rome.")) && (
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Card title="DEVELOPMENT USE ONLY">
|
<Card title="DEVELOPMENT USE ONLY">
|
||||||
<JobCalculateTotals job={job} disabled={jobRO} />
|
<JobCalculateTotals job={job} disabled={jobRO} />
|
||||||
|
|||||||
@@ -123,11 +123,10 @@ export default function JobTotalsTableLabor({ job }) {
|
|||||||
<Space>
|
<Space>
|
||||||
{t("jobs.labels.mapa")}
|
{t("jobs.labels.mapa")}
|
||||||
{job.materials &&
|
{job.materials &&
|
||||||
job.materials.mapa &&
|
job.materials.MAPA &&
|
||||||
job.materials.mapa.cal_maxdlr &&
|
job.materials.MAPA.cal_maxdlr !== undefined &&
|
||||||
job.materials.mapa.cal_maxdlr > 0 &&
|
|
||||||
t("jobs.labels.threshhold", {
|
t("jobs.labels.threshhold", {
|
||||||
amount: job.materials.mapa.cal_maxdlr,
|
amount: job.materials.MAPA.cal_maxdlr,
|
||||||
})}
|
})}
|
||||||
</Space>
|
</Space>
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
@@ -148,11 +147,10 @@ export default function JobTotalsTableLabor({ job }) {
|
|||||||
<Space wrap>
|
<Space wrap>
|
||||||
{t("jobs.labels.mash")}
|
{t("jobs.labels.mash")}
|
||||||
{job.materials &&
|
{job.materials &&
|
||||||
job.materials.mash &&
|
job.materials.MASH &&
|
||||||
job.materials.mash.cal_maxdlr &&
|
job.materials.MASH.cal_maxdlr !== undefined &&
|
||||||
job.materials.mash.cal_maxdlr > 0 &&
|
|
||||||
t("jobs.labels.threshhold", {
|
t("jobs.labels.threshhold", {
|
||||||
amount: job.materials.mash.cal_maxdlr,
|
amount: job.materials.MASH.cal_maxdlr,
|
||||||
})}
|
})}
|
||||||
</Space>
|
</Space>
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
|
|||||||
@@ -11,6 +11,22 @@ export default function JobTotalsTableParts({ job }) {
|
|||||||
filteredInfo: {},
|
filteredInfo: {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const insuranceAdjustments = useMemo(() => {
|
||||||
|
if (!job.job_totals) return [];
|
||||||
|
if (!job.job_totals?.parts?.adjustments) return [];
|
||||||
|
const adjs = [];
|
||||||
|
Object.keys(job.job_totals?.parts?.adjustments).forEach((key) => {
|
||||||
|
if (Dinero(job.job_totals?.parts?.adjustments[key]).getAmount() !== 0) {
|
||||||
|
adjs.push({
|
||||||
|
id: key,
|
||||||
|
amount: Dinero(job.job_totals.parts.adjustments[key]),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return adjs;
|
||||||
|
}, [job.job_totals]);
|
||||||
|
|
||||||
const data = useMemo(() => {
|
const data = useMemo(() => {
|
||||||
return Object.keys(job.job_totals.parts.parts.list)
|
return Object.keys(job.job_totals.parts.parts.list)
|
||||||
.filter(
|
.filter(
|
||||||
@@ -74,11 +90,11 @@ export default function JobTotalsTableParts({ job }) {
|
|||||||
<Table.Summary.Cell>
|
<Table.Summary.Cell>
|
||||||
{t("jobs.labels.prt_dsmk_total")}
|
{t("jobs.labels.prt_dsmk_total")}
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
|
|
||||||
<Table.Summary.Cell align="right">
|
<Table.Summary.Cell align="right">
|
||||||
{Dinero(job.job_totals.parts.parts.prt_dsmk_total).toFormat()}
|
{Dinero(job.job_totals.parts.parts.prt_dsmk_total).toFormat()}
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
</Table.Summary.Row>
|
</Table.Summary.Row>
|
||||||
|
|
||||||
<Table.Summary.Row>
|
<Table.Summary.Row>
|
||||||
<Table.Summary.Cell>
|
<Table.Summary.Cell>
|
||||||
<strong>{t("jobs.labels.partstotal")}</strong>
|
<strong>{t("jobs.labels.partstotal")}</strong>
|
||||||
@@ -90,6 +106,24 @@ export default function JobTotalsTableParts({ job }) {
|
|||||||
</strong>
|
</strong>
|
||||||
</Table.Summary.Cell>
|
</Table.Summary.Cell>
|
||||||
</Table.Summary.Row>
|
</Table.Summary.Row>
|
||||||
|
{insuranceAdjustments.length > 0 && (
|
||||||
|
<Table.Summary.Row>
|
||||||
|
<Table.Summary.Cell colSpan={24}>
|
||||||
|
{t("jobs.labels.profileadjustments")}
|
||||||
|
</Table.Summary.Cell>
|
||||||
|
</Table.Summary.Row>
|
||||||
|
)}
|
||||||
|
{insuranceAdjustments.map((adj, idx) => (
|
||||||
|
<Table.Summary.Row key={idx}>
|
||||||
|
<Table.Summary.Cell>
|
||||||
|
{t(`jobs.fields.${adj.id.toLowerCase()}`)}
|
||||||
|
</Table.Summary.Cell>
|
||||||
|
|
||||||
|
<Table.Summary.Cell align="right">
|
||||||
|
{adj.amount.toFormat()}
|
||||||
|
</Table.Summary.Cell>
|
||||||
|
</Table.Summary.Row>
|
||||||
|
))}
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@@ -28,26 +28,109 @@ export function JobTotalsTableTotals({ bodyshop, job }) {
|
|||||||
total: job.job_totals.totals.subtotal,
|
total: job.job_totals.totals.subtotal,
|
||||||
bold: true,
|
bold: true,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
key: t("jobs.labels.local_tax_amt"),
|
...(job.job_totals.totals.us_sales_tax_breakdown
|
||||||
total: job.job_totals.totals.local_tax,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: t("jobs.labels.state_tax_amt"),
|
|
||||||
total: job.job_totals.totals.state_tax,
|
|
||||||
},
|
|
||||||
...(bodyshop.region_config === "CA_BC"
|
|
||||||
? [
|
? [
|
||||||
{
|
{
|
||||||
key: t("jobs.fields.ca_bc_pvrt"),
|
key: `${
|
||||||
total: job.job_totals.additional.pvrt,
|
bodyshop.md_responsibility_centers.taxes.tax_ty1?.tax_type1 ||
|
||||||
|
"T1"
|
||||||
|
} - ${[
|
||||||
|
job.cieca_pft.ty1_rate1,
|
||||||
|
job.cieca_pft.ty1_rate2,
|
||||||
|
job.cieca_pft.ty1_rate3,
|
||||||
|
job.cieca_pft.ty1_rate4,
|
||||||
|
job.cieca_pft.ty1_rate5,
|
||||||
|
]
|
||||||
|
.filter((i) => i > 0)
|
||||||
|
.join(", ")}%`,
|
||||||
|
total: job.job_totals.totals.us_sales_tax_breakdown.ty1Tax,
|
||||||
},
|
},
|
||||||
]
|
{
|
||||||
: []),
|
key: `${
|
||||||
{
|
bodyshop.md_responsibility_centers.taxes.tax_ty2?.tax_type2 ||
|
||||||
key: t("jobs.labels.federal_tax_amt"),
|
"T2"
|
||||||
total: job.job_totals.totals.federal_tax,
|
} - ${[
|
||||||
},
|
job.cieca_pft.ty2_rate1,
|
||||||
|
job.cieca_pft.ty2_rate2,
|
||||||
|
job.cieca_pft.ty2_rate3,
|
||||||
|
job.cieca_pft.ty2_rate4,
|
||||||
|
job.cieca_pft.ty2_rate5,
|
||||||
|
]
|
||||||
|
.filter((i) => i > 0)
|
||||||
|
.join(", ")}%`,
|
||||||
|
total: job.job_totals.totals.us_sales_tax_breakdown.ty2Tax,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: `${
|
||||||
|
bodyshop.md_responsibility_centers.taxes.tax_ty3?.tax_type3 ||
|
||||||
|
"T3"
|
||||||
|
} - ${[
|
||||||
|
job.cieca_pft.ty3_rate1,
|
||||||
|
job.cieca_pft.ty3_rate2,
|
||||||
|
job.cieca_pft.ty3_rate3,
|
||||||
|
job.cieca_pft.ty3_rate4,
|
||||||
|
job.cieca_pft.ty3_rate5,
|
||||||
|
]
|
||||||
|
.filter((i) => i > 0)
|
||||||
|
.join(", ")}%`,
|
||||||
|
total: job.job_totals.totals.us_sales_tax_breakdown.ty3Tax,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: `${
|
||||||
|
bodyshop.md_responsibility_centers.taxes.tax_ty4?.tax_type4 ||
|
||||||
|
"T4"
|
||||||
|
} - ${[
|
||||||
|
job.cieca_pft.ty4_rate1,
|
||||||
|
job.cieca_pft.ty4_rate2,
|
||||||
|
job.cieca_pft.ty4_rate3,
|
||||||
|
job.cieca_pft.ty4_rate4,
|
||||||
|
job.cieca_pft.ty4_rate5,
|
||||||
|
]
|
||||||
|
.filter((i) => i > 0)
|
||||||
|
.join(", ")}%`,
|
||||||
|
total: job.job_totals.totals.us_sales_tax_breakdown.ty4Tax,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: `${
|
||||||
|
bodyshop.md_responsibility_centers.taxes.tax_ty5?.tax_type5 ||
|
||||||
|
"TT"
|
||||||
|
} - ${[
|
||||||
|
job.cieca_pft.ty5_rate1,
|
||||||
|
job.cieca_pft.ty5_rate2,
|
||||||
|
job.cieca_pft.ty5_rate3,
|
||||||
|
job.cieca_pft.ty5_rate4,
|
||||||
|
job.cieca_pft.ty5_rate5,
|
||||||
|
]
|
||||||
|
.filter((i) => i > 0)
|
||||||
|
.join(", ")}%`,
|
||||||
|
total: job.job_totals.totals.us_sales_tax_breakdown.ty5Tax,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: t("jobs.labels.total_sales_tax"),
|
||||||
|
bold: true,
|
||||||
|
total: Dinero(job.job_totals.totals.us_sales_tax_breakdown.ty1Tax)
|
||||||
|
.add(
|
||||||
|
Dinero(job.job_totals.totals.us_sales_tax_breakdown.ty2Tax)
|
||||||
|
)
|
||||||
|
.add(
|
||||||
|
Dinero(job.job_totals.totals.us_sales_tax_breakdown.ty3Tax)
|
||||||
|
)
|
||||||
|
.add(
|
||||||
|
Dinero(job.job_totals.totals.us_sales_tax_breakdown.ty4Tax)
|
||||||
|
)
|
||||||
|
.add(
|
||||||
|
Dinero(job.job_totals.totals.us_sales_tax_breakdown.ty5Tax)
|
||||||
|
).toJSON(),
|
||||||
|
},
|
||||||
|
].filter((item) => item.total.amount !== 0)
|
||||||
|
: [
|
||||||
|
{
|
||||||
|
key: t("jobs.labels.state_tax_amt"),
|
||||||
|
total: job.job_totals.totals.state_tax,
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
|
||||||
{
|
{
|
||||||
key: t("jobs.labels.total_repairs"),
|
key: t("jobs.labels.total_repairs"),
|
||||||
total: job.job_totals.totals.total_repairs,
|
total: job.job_totals.totals.total_repairs,
|
||||||
@@ -57,10 +140,10 @@ export function JobTotalsTableTotals({ bodyshop, job }) {
|
|||||||
key: t("jobs.fields.ded_amt"),
|
key: t("jobs.fields.ded_amt"),
|
||||||
total: job.job_totals.totals.custPayable.deductible,
|
total: job.job_totals.totals.custPayable.deductible,
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
key: t("jobs.fields.federal_tax_payable"),
|
// key: t("jobs.fields.federal_tax_payable"),
|
||||||
total: job.job_totals.totals.custPayable.federal_tax,
|
// total: job.job_totals.totals.custPayable.federal_tax,
|
||||||
},
|
// },
|
||||||
{
|
{
|
||||||
key: t("jobs.fields.other_amount_payable"),
|
key: t("jobs.fields.other_amount_payable"),
|
||||||
total: job.job_totals.totals.custPayable.other_customer_amount,
|
total: job.job_totals.totals.custPayable.other_customer_amount,
|
||||||
@@ -81,7 +164,7 @@ export function JobTotalsTableTotals({ bodyshop, job }) {
|
|||||||
bold: true,
|
bold: true,
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}, [job.job_totals, t, bodyshop.region_config]);
|
}, [job.job_totals, job.cieca_pft, t, bodyshop.md_responsibility_centers]);
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -53,12 +53,14 @@ export function JobsAdminStatus({ insertAuditTrail, bodyshop, job }) {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Dropdown overlay={statusmenu} trigger={["click"]} key="changestatus">
|
<>
|
||||||
<Button shape="round">
|
<Dropdown overlay={statusmenu} trigger={["click"]} key="changestatus">
|
||||||
<span>{job.status}</span>
|
<Button shape="round">
|
||||||
|
<span>{job.status}</span>
|
||||||
|
|
||||||
<DownCircleFilled />
|
<DownCircleFilled />
|
||||||
</Button>
|
</Button>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,34 +1,18 @@
|
|||||||
import { useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, notification } from "antd";
|
import { Button, Space, notification } from "antd";
|
||||||
import { gql } from "@apollo/client";
|
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
import {
|
||||||
|
DELETE_DELIVERY_CHECKLIST,
|
||||||
|
DELETE_INTAKE_CHECKLIST,
|
||||||
|
} from "../../graphql/jobs.queries";
|
||||||
|
|
||||||
export default function JobAdminDeleteIntake({ job }) {
|
export default function JobAdminDeleteIntake({ job }) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [deleteIntake] = useMutation(gql`
|
|
||||||
mutation DELETE_INTAKE($jobId: uuid!) {
|
|
||||||
update_jobs_by_pk(
|
|
||||||
pk_columns: { id: $jobId }
|
|
||||||
_set: { intakechecklist: null }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
intakechecklist
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
|
|
||||||
const [DELETE_DELIVERY] = useMutation(gql`
|
const [deleteIntake] = useMutation(DELETE_INTAKE_CHECKLIST);
|
||||||
mutation DELETE_DELIVERY($jobId: uuid!) {
|
const [deleteDelivery] = useMutation(DELETE_DELIVERY_CHECKLIST);
|
||||||
update_jobs_by_pk(
|
|
||||||
pk_columns: { id: $jobId }
|
|
||||||
_set: { deliverchecklist: null }
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
deliverchecklist
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
|
|
||||||
const handleDelete = async (values) => {
|
const handleDelete = async (values) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
@@ -50,7 +34,7 @@ export default function JobAdminDeleteIntake({ job }) {
|
|||||||
|
|
||||||
const handleDeleteDelivery = async (values) => {
|
const handleDeleteDelivery = async (values) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const result = await DELETE_DELIVERY({
|
const result = await deleteDelivery({
|
||||||
variables: { jobId: job.id },
|
variables: { jobId: job.id },
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -68,12 +52,22 @@ export default function JobAdminDeleteIntake({ job }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button loading={loading} onClick={handleDelete}>
|
<Space wrap>
|
||||||
{t("jobs.labels.deleteintake")}
|
<Button
|
||||||
</Button>
|
loading={loading}
|
||||||
<Button loading={loading} onClick={handleDeleteDelivery}>
|
onClick={handleDelete}
|
||||||
{t("jobs.labels.deletedelivery")}
|
disabled={!job.intakechecklist}
|
||||||
</Button>
|
>
|
||||||
|
{t("jobs.labels.deleteintake")}
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
loading={loading}
|
||||||
|
onClick={handleDeleteDelivery}
|
||||||
|
disabled={!job.deliverychecklist}
|
||||||
|
>
|
||||||
|
{t("jobs.labels.deletedelivery")}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { gql, useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, notification } from "antd";
|
import { Button, Space, notification } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
@@ -7,6 +7,11 @@ import moment from "moment";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
||||||
|
import {
|
||||||
|
MARK_JOB_AS_EXPORTED,
|
||||||
|
MARK_JOB_AS_UNINVOICED,
|
||||||
|
MARK_JOB_FOR_REEXPORT,
|
||||||
|
} from "../../graphql/jobs.queries";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import {
|
import {
|
||||||
selectBodyshop,
|
selectBodyshop,
|
||||||
@@ -35,58 +40,18 @@ export function JobAdminMarkReexport({
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
const [insertExportLog] = useMutation(INSERT_EXPORT_LOG);
|
||||||
const [markJobForReexport] = useMutation(gql`
|
|
||||||
mutation MARK_JOB_FOR_REEXPORT($jobId: uuid!) {
|
|
||||||
update_jobs_by_pk(
|
|
||||||
pk_columns: { id: $jobId }
|
|
||||||
_set: { date_exported: null
|
|
||||||
status: "${bodyshop.md_ro_statuses.default_invoiced}"
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
date_exported
|
|
||||||
status
|
|
||||||
date_invoiced
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
|
|
||||||
const [markJobExported] = useMutation(gql`
|
const [markJobForReexport] = useMutation(MARK_JOB_FOR_REEXPORT);
|
||||||
mutation MARK_JOB_AS_EXPORTED($jobId: uuid!, $date_exported: timestamptz!) {
|
const [markJobExported] = useMutation(MARK_JOB_AS_EXPORTED);
|
||||||
update_jobs_by_pk(
|
const [markJobUninvoiced] = useMutation(MARK_JOB_AS_UNINVOICED);
|
||||||
pk_columns: { id: $jobId }
|
|
||||||
_set: { date_exported: $date_exported
|
|
||||||
status: "${bodyshop.md_ro_statuses.default_exported}"
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
date_exported
|
|
||||||
date_invoiced
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
const [markJobUninvoiced] = useMutation(gql`
|
|
||||||
mutation MARK_JOB_AS_UNINVOICED($jobId: uuid!, ) {
|
|
||||||
update_jobs_by_pk(
|
|
||||||
pk_columns: { id: $jobId }
|
|
||||||
_set: { date_exported: null
|
|
||||||
date_invoiced: null
|
|
||||||
status: "${bodyshop.md_ro_statuses.default_delivered}"
|
|
||||||
}
|
|
||||||
) {
|
|
||||||
id
|
|
||||||
date_exported
|
|
||||||
date_invoiced
|
|
||||||
status
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`);
|
|
||||||
|
|
||||||
const handleMarkForExport = async () => {
|
const handleMarkForExport = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const result = await markJobForReexport({
|
const result = await markJobForReexport({
|
||||||
variables: { jobId: job.id },
|
variables: {
|
||||||
|
jobId: job.id,
|
||||||
|
default_invoiced: bodyshop.md_ro_statuses.default_invoiced,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result.errors) {
|
if (!result.errors) {
|
||||||
@@ -108,7 +73,11 @@ export function JobAdminMarkReexport({
|
|||||||
const handleMarkExported = async () => {
|
const handleMarkExported = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const result = await markJobExported({
|
const result = await markJobExported({
|
||||||
variables: { jobId: job.id, date_exported: moment() },
|
variables: {
|
||||||
|
jobId: job.id,
|
||||||
|
date_exported: moment(),
|
||||||
|
default_exported: bodyshop.md_ro_statuses.default_exported,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
await insertExportLog({
|
await insertExportLog({
|
||||||
@@ -144,7 +113,10 @@ export function JobAdminMarkReexport({
|
|||||||
const handleUninvoice = async () => {
|
const handleUninvoice = async () => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const result = await markJobUninvoiced({
|
const result = await markJobUninvoiced({
|
||||||
variables: { jobId: job.id },
|
variables: {
|
||||||
|
jobId: job.id,
|
||||||
|
default_delivered: bodyshop.md_ro_statuses.default_delivered,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result.errors) {
|
if (!result.errors) {
|
||||||
@@ -165,27 +137,29 @@ export function JobAdminMarkReexport({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button
|
<Space wrap>
|
||||||
loading={loading}
|
<Button
|
||||||
disabled={!job.date_exported}
|
loading={loading}
|
||||||
onClick={handleMarkForExport}
|
disabled={!job.date_exported}
|
||||||
>
|
onClick={handleMarkForExport}
|
||||||
{t("jobs.labels.markforreexport")}
|
>
|
||||||
</Button>
|
{t("jobs.labels.markforreexport")}
|
||||||
<Button
|
</Button>
|
||||||
loading={loading}
|
<Button
|
||||||
disabled={job.date_exported}
|
loading={loading}
|
||||||
onClick={handleMarkExported}
|
disabled={job.date_exported}
|
||||||
>
|
onClick={handleMarkExported}
|
||||||
{t("jobs.actions.markasexported")}
|
>
|
||||||
</Button>
|
{t("jobs.actions.markasexported")}
|
||||||
<Button
|
</Button>
|
||||||
loading={loading}
|
<Button
|
||||||
disabled={!job.date_invoiced || job.date_exported}
|
loading={loading}
|
||||||
onClick={handleUninvoice}
|
disabled={!job.date_invoiced || job.date_exported}
|
||||||
>
|
onClick={handleUninvoice}
|
||||||
{t("jobs.actions.uninvoice")}
|
>
|
||||||
</Button>
|
{t("jobs.actions.uninvoice")}
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,65 @@
|
|||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Switch, notification } from "antd";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { UPDATE_REMOVE_FROM_AR } from "../../graphql/jobs.queries";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({});
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
|
});
|
||||||
|
|
||||||
|
export default connect(mapStateToProps, mapDispatchToProps)(JobsAdminRemoveAR);
|
||||||
|
|
||||||
|
export function JobsAdminRemoveAR({ insertAuditTrail, job }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [loading, setLoading] = useState(false);
|
||||||
|
const [switchValue, setSwitchValue] = useState(job.remove_from_ar);
|
||||||
|
|
||||||
|
const [mutationUpdateRemoveFromAR] = useMutation(UPDATE_REMOVE_FROM_AR);
|
||||||
|
|
||||||
|
const handleChange = async (value) => {
|
||||||
|
setLoading(true);
|
||||||
|
const result = await mutationUpdateRemoveFromAR({
|
||||||
|
variables: { jobId: job.id, remove_from_ar: value },
|
||||||
|
});
|
||||||
|
|
||||||
|
if (!result.errors) {
|
||||||
|
notification["success"]({ message: t("jobs.successes.save") });
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: job.id,
|
||||||
|
operation: AuditTrailMapping.admin_job_remove_from_ar(value),
|
||||||
|
});
|
||||||
|
setSwitchValue(value);
|
||||||
|
} else {
|
||||||
|
notification["error"]({
|
||||||
|
message: t("jobs.errors.saving", {
|
||||||
|
error: JSON.stringify(result.errors),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
setLoading(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div style={{ display: "flex", alignItems: "center" }}>
|
||||||
|
<div style={{ marginRight: "10px" }}>
|
||||||
|
{t("jobs.labels.remove_from_ar")}:
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<Switch
|
||||||
|
checked={switchValue}
|
||||||
|
loading={loading}
|
||||||
|
onChange={handleChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,9 +1,10 @@
|
|||||||
import { gql, useMutation } from "@apollo/client";
|
import { useMutation } from "@apollo/client";
|
||||||
import { Button, notification } from "antd";
|
import { Button, notification } from "antd";
|
||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { UNVOID_JOB } from "../../graphql/jobs.queries";
|
||||||
import { insertAuditTrail } from "../../redux/application/application.actions";
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import {
|
import {
|
||||||
selectBodyshop,
|
selectBodyshop,
|
||||||
@@ -29,66 +30,17 @@ export function JobsAdminUnvoid({
|
|||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [loading, setLoading] = useState(false);
|
const [loading, setLoading] = useState(false);
|
||||||
const [updateJob] = useMutation(gql`
|
const [mutationUnvoidJob] = useMutation(UNVOID_JOB);
|
||||||
mutation UNVOID_JOB($jobId: uuid!) {
|
|
||||||
update_jobs_by_pk(pk_columns: {id: $jobId}, _set: {voided: false, status: "${
|
|
||||||
bodyshop.md_ro_statuses.default_imported
|
|
||||||
}", date_void: null}) {
|
|
||||||
id
|
|
||||||
date_void
|
|
||||||
voided
|
|
||||||
status
|
|
||||||
}
|
|
||||||
insert_notes(objects: {jobid: $jobId, audit: true, created_by: "${
|
|
||||||
currentUser.email
|
|
||||||
}", text: "${t("jobs.labels.unvoidnote")}"}) {
|
|
||||||
returning {
|
|
||||||
id
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
`);
|
|
||||||
|
|
||||||
// const result = await voidJob({
|
|
||||||
// variables: {
|
|
||||||
// jobId: job.id,
|
|
||||||
// job: {
|
|
||||||
// status: bodyshop.md_ro_statuses.default_void,
|
|
||||||
// voided: true,
|
|
||||||
// },
|
|
||||||
// note: [
|
|
||||||
// {
|
|
||||||
// jobid: job.id,
|
|
||||||
// created_by: currentUser.email,
|
|
||||||
// audit: true,
|
|
||||||
// text: t("jobs.labels.voidnote", {
|
|
||||||
// date: moment().format("MM/DD/yyy"),
|
|
||||||
// time: moment().format("hh:mm a"),
|
|
||||||
// }),
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
|
|
||||||
// if (!!!result.errors) {
|
|
||||||
// notification["success"]({
|
|
||||||
// message: t("jobs.successes.voided"),
|
|
||||||
// });
|
|
||||||
// //go back to jobs list.
|
|
||||||
// history.push(`/manage/`);
|
|
||||||
// } else {
|
|
||||||
// notification["error"]({
|
|
||||||
// message: t("jobs.errors.voiding", {
|
|
||||||
// error: JSON.stringify(result.errors),
|
|
||||||
// }),
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
|
|
||||||
const handleUpdate = async (values) => {
|
const handleUpdate = async (values) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const result = await updateJob({
|
const result = await mutationUnvoidJob({
|
||||||
variables: { jobId: job.id },
|
variables: {
|
||||||
|
jobId: job.id,
|
||||||
|
default_imported: bodyshop.md_ro_statuses.default_imported,
|
||||||
|
currentUserEmail: currentUser.email,
|
||||||
|
text: t("jobs.labels.unvoidnote"),
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!result.errors) {
|
if (!result.errors) {
|
||||||
@@ -110,8 +62,10 @@ mutation UNVOID_JOB($jobId: uuid!) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Button loading={loading} disabled={!job.voided} onClick={handleUpdate}>
|
<>
|
||||||
{t("jobs.actions.unvoid")}
|
<Button loading={loading} disabled={!job.voided} onClick={handleUpdate}>
|
||||||
</Button>
|
{t("jobs.actions.unvoid")}
|
||||||
|
</Button>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ export const GetSupplementDelta = async (client, jobId, newLines) => {
|
|||||||
//Found a relevant matching line. Add it to lines to update.
|
//Found a relevant matching line. Add it to lines to update.
|
||||||
linesToUpdate.push({
|
linesToUpdate.push({
|
||||||
id: existingLines[matchingIndex].id,
|
id: existingLines[matchingIndex].id,
|
||||||
newData: { ...newLine, removed: false },
|
newData: { ...newLine, removed: false, act_price_before_ppc: null },
|
||||||
});
|
});
|
||||||
|
|
||||||
//Splice out item we found for performance.
|
//Splice out item we found for performance.
|
||||||
|
|||||||
@@ -6,10 +6,10 @@ import {
|
|||||||
useQuery,
|
useQuery,
|
||||||
} from "@apollo/client";
|
} from "@apollo/client";
|
||||||
import { useTreatments } from "@splitsoftware/splitio-react";
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
import { Col, notification, Row } from "antd";
|
import { Button, Col, Row, notification } from "antd";
|
||||||
import Axios from "axios";
|
import Axios from "axios";
|
||||||
import Dinero from "dinero.js";
|
import _ from "lodash";
|
||||||
import moment from "moment";
|
import moment from "moment-business-days";
|
||||||
import queryString from "query-string";
|
import queryString from "query-string";
|
||||||
import React, { useCallback, useEffect, useState } from "react";
|
import React, { useCallback, useEffect, useState } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
@@ -30,8 +30,8 @@ import {
|
|||||||
selectBodyshop,
|
selectBodyshop,
|
||||||
selectCurrentUser,
|
selectCurrentUser,
|
||||||
} from "../../redux/user/user.selectors";
|
} from "../../redux/user/user.selectors";
|
||||||
import confirmDialog from "../../utils/asyncConfirm";
|
|
||||||
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
|
//import confirmDialog from "../../utils/asyncConfirm";
|
||||||
import CriticalPartsScan from "../../utils/criticalPartsScan";
|
import CriticalPartsScan from "../../utils/criticalPartsScan";
|
||||||
import AlertComponent from "../alert/alert.component";
|
import AlertComponent from "../alert/alert.component";
|
||||||
import JobsAvailableScan from "../jobs-available-scan/jobs-available-scan.component";
|
import JobsAvailableScan from "../jobs-available-scan/jobs-available-scan.component";
|
||||||
@@ -73,7 +73,15 @@ export function JobsAvailableContainer({
|
|||||||
|
|
||||||
const [selectedJob, setSelectedJob] = useState(null);
|
const [selectedJob, setSelectedJob] = useState(null);
|
||||||
const [selectedOwner, setSelectedOwner] = useState(null);
|
const [selectedOwner, setSelectedOwner] = useState(null);
|
||||||
const [partsQueueToggle, setPartsQueueToggle] = useState(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
const [partsQueueToggle, setPartsQueueToggle] = useState(
|
||||||
|
bodyshop.md_functionality_toggles.parts_queue_toggle
|
||||||
|
);
|
||||||
|
const [updateSchComp, setSchComp] = useState({
|
||||||
|
actual_in: moment(),
|
||||||
|
checked: false,
|
||||||
|
scheduled_completion: moment(),
|
||||||
|
automatic: false,
|
||||||
|
});
|
||||||
|
|
||||||
const [insertLoading, setInsertLoading] = useState(false);
|
const [insertLoading, setInsertLoading] = useState(false);
|
||||||
|
|
||||||
@@ -92,14 +100,15 @@ export function JobsAvailableContainer({
|
|||||||
const modalSearchState = useState("");
|
const modalSearchState = useState("");
|
||||||
|
|
||||||
//Import Scenario
|
//Import Scenario
|
||||||
const onOwnerFindModalOk = async () => {
|
const onOwnerFindModalOk = async (lazyData) => {
|
||||||
logImEXEvent("job_import_new");
|
logImEXEvent("job_import_new");
|
||||||
|
|
||||||
setOwnerModalVisible(false);
|
setOwnerModalVisible(false);
|
||||||
|
|
||||||
setInsertLoading(true);
|
setInsertLoading(true);
|
||||||
|
const estData = replaceEmpty(
|
||||||
const estData = replaceEmpty(estDataRaw.data.available_jobs_by_pk);
|
lazyData?.available_jobs_by_pk || estDataRaw.data.available_jobs_by_pk
|
||||||
|
);
|
||||||
|
|
||||||
if (!(estData && estData.est_data)) {
|
if (!(estData && estData.est_data)) {
|
||||||
//We don't have the right data. Error!
|
//We don't have the right data. Error!
|
||||||
@@ -109,17 +118,21 @@ export function JobsAvailableContainer({
|
|||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// if (process.env.REACT_APP_COUNTRY === "USA") {
|
||||||
|
//Massage the CCC file set to remove duplicate UNQ_SEQ.
|
||||||
|
await ResolveCCCLineIssues(estData.est_data, bodyshop);
|
||||||
|
// } else {
|
||||||
//IO-539 Check for Parts Rate on PAL for SGI use case.
|
//IO-539 Check for Parts Rate on PAL for SGI use case.
|
||||||
await CheckTaxRates(estData.est_data, bodyshop);
|
await CheckTaxRates(estData.est_data, bodyshop);
|
||||||
|
// }
|
||||||
const newTotals = (
|
// const newTotals = (
|
||||||
await Axios.post("/job/totals", {
|
// await Axios.post("/job/totals", {
|
||||||
job: {
|
// job: {
|
||||||
...estData.est_data,
|
// ...estData.est_data,
|
||||||
joblines: estData.est_data.joblines.data,
|
// joblines: estData.est_data.joblines.data,
|
||||||
},
|
// },
|
||||||
})
|
// })
|
||||||
).data;
|
// ).data;
|
||||||
|
|
||||||
let existingVehicles;
|
let existingVehicles;
|
||||||
if (estData.est_data.v_vin) {
|
if (estData.est_data.v_vin) {
|
||||||
@@ -134,9 +147,9 @@ export function JobsAvailableContainer({
|
|||||||
|
|
||||||
const newJob = {
|
const newJob = {
|
||||||
...estData.est_data,
|
...estData.est_data,
|
||||||
clm_total: Dinero(newTotals.totals.total_repairs).toFormat("0.00"),
|
// clm_total: Dinero(newTotals.totals.total_repairs).toFormat("0.00"),
|
||||||
owner_owing: Dinero(newTotals.totals.custPayable.total).toFormat("0.00"),
|
// owner_owing: Dinero(newTotals.totals.custPayable.total).toFormat("0.00"),
|
||||||
job_totals: newTotals,
|
// job_totals: newTotals,
|
||||||
date_open: moment(),
|
date_open: moment(),
|
||||||
status: bodyshop.md_ro_statuses.default_imported,
|
status: bodyshop.md_ro_statuses.default_imported,
|
||||||
notes: {
|
notes: {
|
||||||
@@ -160,17 +173,23 @@ export function JobsAvailableContainer({
|
|||||||
delete newJob.vehicle;
|
delete newJob.vehicle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof newJob.kmin === "string") {
|
||||||
|
newJob.kmin = null;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const r = await insertNewJob({
|
const r = await insertNewJob({
|
||||||
variables: {
|
variables: {
|
||||||
job: newJob,
|
job: newJob,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
await Axios.post("/job/totalsssu", {
|
||||||
|
id: r.data.insert_jobs.returning[0].id,
|
||||||
|
});
|
||||||
|
|
||||||
if (CriticalPartsScanning.treatment === "on") {
|
if (CriticalPartsScanning.treatment === "on") {
|
||||||
CriticalPartsScan(r.data.insert_jobs.returning[0].id);
|
CriticalPartsScan(r.data.insert_jobs.returning[0].id);
|
||||||
}
|
}
|
||||||
|
|
||||||
notification["success"]({
|
notification["success"]({
|
||||||
message: t("jobs.successes.created"),
|
message: t("jobs.successes.created"),
|
||||||
onClick: () => {
|
onClick: () => {
|
||||||
@@ -184,7 +203,7 @@ export function JobsAvailableContainer({
|
|||||||
operation: AuditTrailMapping.jobimported(),
|
operation: AuditTrailMapping.jobimported(),
|
||||||
});
|
});
|
||||||
|
|
||||||
deleteJob({
|
await deleteJob({
|
||||||
variables: { id: estData.id },
|
variables: { id: estData.id },
|
||||||
}).then((r) => {
|
}).then((r) => {
|
||||||
refetch();
|
refetch();
|
||||||
@@ -192,16 +211,22 @@ export function JobsAvailableContainer({
|
|||||||
});
|
});
|
||||||
|
|
||||||
setPartsQueueToggle(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
setPartsQueueToggle(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
||||||
} catch (err) {
|
} catch (r) {
|
||||||
//error while inserting
|
//error while inserting
|
||||||
notification["error"]({
|
notification["error"]({
|
||||||
message: t("jobs.errors.creating", { error: err.message }),
|
message: t("jobs.errors.creating", { error: r.message }),
|
||||||
|
});
|
||||||
|
refetch().catch((err) => {
|
||||||
|
console.error(
|
||||||
|
`Something went wrong in jobs available table container - ${
|
||||||
|
err.message || ""
|
||||||
|
}`
|
||||||
|
);
|
||||||
});
|
});
|
||||||
refetch().catch(e => {console.error(`Something went wrong in jobs available table container - ${err.message || ''}`)});
|
|
||||||
setInsertLoading(false);
|
setInsertLoading(false);
|
||||||
setPartsQueueToggle(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
setPartsQueueToggle(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//Supplement scenario
|
//Supplement scenario
|
||||||
@@ -224,6 +249,23 @@ export function JobsAvailableContainer({
|
|||||||
let supp = replaceEmpty({ ...estData.est_data });
|
let supp = replaceEmpty({ ...estData.est_data });
|
||||||
//IO-539 Check for Parts Rate on PAL for SGI use case.
|
//IO-539 Check for Parts Rate on PAL for SGI use case.
|
||||||
await CheckTaxRates(supp, bodyshop);
|
await CheckTaxRates(supp, bodyshop);
|
||||||
|
await ResolveCCCLineIssues(supp, bodyshop);
|
||||||
|
|
||||||
|
if (updateSchComp.checked === true) {
|
||||||
|
if (updateSchComp.automatic === true) {
|
||||||
|
const job_hrs = supp.joblines.data.reduce(
|
||||||
|
(acc, val) => acc + val.mod_lb_hrs,
|
||||||
|
0
|
||||||
|
);
|
||||||
|
const num_days = job_hrs / bodyshop.target_touchtime;
|
||||||
|
supp.actual_in = updateSchComp.actual_in;
|
||||||
|
supp.scheduled_completion = moment(
|
||||||
|
updateSchComp.actual_in
|
||||||
|
).businessAdd(num_days, "days");
|
||||||
|
} else {
|
||||||
|
supp.scheduled_completion = updateSchComp.scheduled_completion;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
delete supp.owner;
|
delete supp.owner;
|
||||||
delete supp.vehicle;
|
delete supp.vehicle;
|
||||||
@@ -261,9 +303,9 @@ export function JobsAvailableContainer({
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
setPartsQueueToggle(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
setPartsQueueToggle(bodyshop.md_functionality_toggles.parts_queue_toggle);
|
||||||
|
|
||||||
if (CriticalPartsScanning.treatment === "on") {
|
if (CriticalPartsScanning.treatment === "on") {
|
||||||
CriticalPartsScan(updateResult.data.update_jobs.returning[0].id);
|
CriticalPartsScan(updateResult.data.update_jobs.returning[0].id);
|
||||||
}
|
}
|
||||||
if (updateResult.errors) {
|
if (updateResult.errors) {
|
||||||
@@ -367,7 +409,6 @@ export function JobsAvailableContainer({
|
|||||||
|
|
||||||
if (error) return <AlertComponent type="error" message={error.message} />;
|
if (error) return <AlertComponent type="error" message={error.message} />;
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<LoadingSpinner
|
<LoadingSpinner
|
||||||
loading={insertLoading}
|
loading={insertLoading}
|
||||||
@@ -384,7 +425,6 @@ export function JobsAvailableContainer({
|
|||||||
visible={ownerModalVisible}
|
visible={ownerModalVisible}
|
||||||
onOk={onOwnerFindModalOk}
|
onOk={onOwnerFindModalOk}
|
||||||
onCancel={onOwnerModalCancel}
|
onCancel={onOwnerModalCancel}
|
||||||
|
|
||||||
/>
|
/>
|
||||||
<JobsFindModalContainer
|
<JobsFindModalContainer
|
||||||
loading={estDataRaw.loading}
|
loading={estDataRaw.loading}
|
||||||
@@ -398,7 +438,28 @@ export function JobsAvailableContainer({
|
|||||||
modalSearchState={modalSearchState}
|
modalSearchState={modalSearchState}
|
||||||
partsQueueToggle={partsQueueToggle}
|
partsQueueToggle={partsQueueToggle}
|
||||||
setPartsQueueToggle={setPartsQueueToggle}
|
setPartsQueueToggle={setPartsQueueToggle}
|
||||||
|
updateSchComp={updateSchComp}
|
||||||
|
setSchComp={setSchComp}
|
||||||
/>
|
/>
|
||||||
|
{currentUser.email.includes("@rome.") ||
|
||||||
|
currentUser.email.includes("@imex.") ? (
|
||||||
|
<Button
|
||||||
|
onClick={async () => {
|
||||||
|
for (const record of data.available_jobs) {
|
||||||
|
//Query the data
|
||||||
|
console.log("Start Job", record.id);
|
||||||
|
const { data } = await loadEstData({
|
||||||
|
variables: { id: record.id },
|
||||||
|
});
|
||||||
|
console.log("Query has been awaited and is complete");
|
||||||
|
await onOwnerFindModalOk(data);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
Add all jobs as new.
|
||||||
|
</Button>
|
||||||
|
) : null}
|
||||||
|
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<JobsAvailableTableComponent
|
<JobsAvailableTableComponent
|
||||||
@@ -430,115 +491,158 @@ function replaceEmpty(someObj, replaceValue = null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function CheckTaxRates(estData, bodyshop) {
|
async function CheckTaxRates(estData, bodyshop) {
|
||||||
//LKQ Check
|
// //LKQ Check
|
||||||
if (
|
// if (
|
||||||
!estData.parts_tax_rates?.PAL ||
|
// !estData.parts_tax_rates?.PAL ||
|
||||||
estData.parts_tax_rates?.PAL?.prt_tax_rt === null ||
|
// estData.parts_tax_rates?.PAL?.prt_tax_rt === null ||
|
||||||
estData.parts_tax_rates?.PAL?.prt_tax_rt === 0
|
// estData.parts_tax_rates?.PAL?.prt_tax_rt === 0
|
||||||
) {
|
// ) {
|
||||||
const res = await confirmDialog(
|
// const res = await confirmDialog(
|
||||||
`ImEX Online has detected that there is a missing tax rate for LKQ parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.`
|
// `Rome Online has detected that there is a missing tax rate for LKQ parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.`
|
||||||
);
|
// );
|
||||||
if (res) {
|
// if (res) {
|
||||||
if (!estData.parts_tax_rates.PAL) {
|
// if (!estData.parts_tax_rates.PAL) {
|
||||||
estData.parts_tax_rates.PAL = {
|
// estData.parts_tax_rates.PAL = {
|
||||||
prt_discp: 0,
|
// prt_discp: 0,
|
||||||
prt_mktyp: true,
|
// prt_mktyp: true,
|
||||||
prt_mkupp: 0,
|
// prt_mkupp: 0,
|
||||||
prt_type: "PAL",
|
// prt_type: "PAL",
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
estData.parts_tax_rates.PAL.prt_tax_rt =
|
// estData.parts_tax_rates.PAL.prt_tax_rt =
|
||||||
bodyshop.bill_tax_rates.state_tax_rate / 100;
|
// bodyshop.bill_tax_rates.state_tax_rate / 100;
|
||||||
estData.parts_tax_rates.PAL.prt_tax_in = true;
|
// estData.parts_tax_rates.PAL.prt_tax_in = true;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
//PAC Check
|
// //PAC Check
|
||||||
if (
|
// if (
|
||||||
!estData.parts_tax_rates?.PAC ||
|
// !estData.parts_tax_rates?.PAC ||
|
||||||
estData.parts_tax_rates?.PAC?.prt_tax_rt === null ||
|
// estData.parts_tax_rates?.PAC?.prt_tax_rt === null ||
|
||||||
estData.parts_tax_rates?.PAC?.prt_tax_rt === 0
|
// estData.parts_tax_rates?.PAC?.prt_tax_rt === 0
|
||||||
) {
|
// ) {
|
||||||
const res = await confirmDialog(
|
// const res = await confirmDialog(
|
||||||
`ImEX Online has detected that there is a missing tax rate for rechromed parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.`
|
// `Rome Online has detected that there is a missing tax rate for rechromed parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.`
|
||||||
);
|
// );
|
||||||
if (res) {
|
// if (res) {
|
||||||
if (!estData.parts_tax_rates.PAC) {
|
// if (!estData.parts_tax_rates.PAC) {
|
||||||
estData.parts_tax_rates.PAC = {
|
// estData.parts_tax_rates.PAC = {
|
||||||
prt_discp: 0,
|
// prt_discp: 0,
|
||||||
prt_mktyp: true,
|
// prt_mktyp: true,
|
||||||
prt_mkupp: 0,
|
// prt_mkupp: 0,
|
||||||
prt_type: "PAC",
|
// prt_type: "PAC",
|
||||||
};
|
// };
|
||||||
}
|
// }
|
||||||
estData.parts_tax_rates.PAC.prt_tax_rt =
|
// estData.parts_tax_rates.PAC.prt_tax_rt =
|
||||||
bodyshop.bill_tax_rates.state_tax_rate / 100;
|
// bodyshop.bill_tax_rates.state_tax_rate / 100;
|
||||||
estData.parts_tax_rates.PAC.prt_tax_in = true;
|
// estData.parts_tax_rates.PAC.prt_tax_in = true;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
//PAM Check
|
//PAM Check
|
||||||
if (
|
if (!estData.parts_tax_rates?.PAM) {
|
||||||
!estData.parts_tax_rates?.PAM ||
|
estData.parts_tax_rates.PAM = estData.parts_tax_rates.PAC;
|
||||||
estData.parts_tax_rates?.PAM?.prt_tax_rt === null ||
|
|
||||||
estData.parts_tax_rates?.PAM?.prt_tax_rt === 0
|
|
||||||
) {
|
|
||||||
const res = await confirmDialog(
|
|
||||||
`ImEX Online has detected that there is a missing tax rate for remanufactured parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.`
|
|
||||||
);
|
|
||||||
if (res) {
|
|
||||||
if (!estData.parts_tax_rates.PAM) {
|
|
||||||
estData.parts_tax_rates.PAM = {
|
|
||||||
prt_discp: 0,
|
|
||||||
prt_mktyp: true,
|
|
||||||
prt_mkupp: 0,
|
|
||||||
prt_type: "PAM",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
estData.parts_tax_rates.PAM.prt_tax_rt =
|
|
||||||
bodyshop.bill_tax_rates.state_tax_rate / 100;
|
|
||||||
estData.parts_tax_rates.PAM.prt_tax_in = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
// //PAM Check
|
||||||
!estData.parts_tax_rates?.PAR ||
|
// if (
|
||||||
estData.parts_tax_rates?.PAR?.prt_tax_rt === null ||
|
// !estData.parts_tax_rates?.PAM ||
|
||||||
estData.parts_tax_rates?.PAR?.prt_tax_rt === 0
|
// estData.parts_tax_rates?.PAM?.prt_tax_rt === null ||
|
||||||
) {
|
// estData.parts_tax_rates?.PAM?.prt_tax_rt === 0
|
||||||
const res = await confirmDialog(
|
// ) {
|
||||||
`ImEX Online has detected that there is a missing tax rate for recored parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.`
|
// const res = await confirmDialog(
|
||||||
);
|
// `Rome Online has detected that there is a missing tax rate for remanufactured parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.`
|
||||||
if (res) {
|
// );
|
||||||
if (!estData.parts_tax_rates.PAR) {
|
// if (res) {
|
||||||
estData.parts_tax_rates.PAR = {
|
// if (!estData.parts_tax_rates.PAM) {
|
||||||
prt_discp: 0,
|
// estData.parts_tax_rates.PAM = {
|
||||||
prt_mktyp: true,
|
// prt_discp: 0,
|
||||||
prt_mkupp: 0,
|
// prt_mktyp: true,
|
||||||
prt_type: "PAR",
|
// prt_mkupp: 0,
|
||||||
};
|
// prt_type: "PAM",
|
||||||
}
|
// };
|
||||||
estData.parts_tax_rates.PAR.prt_tax_rt =
|
// }
|
||||||
bodyshop.bill_tax_rates.state_tax_rate / 100;
|
// estData.parts_tax_rates.PAM.prt_tax_rt =
|
||||||
estData.parts_tax_rates.PAR.prt_tax_in = true;
|
// bodyshop.bill_tax_rates.state_tax_rate / 100;
|
||||||
}
|
// estData.parts_tax_rates.PAM.prt_tax_in = true;
|
||||||
}
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// if (
|
||||||
|
// !estData.parts_tax_rates?.PAR ||
|
||||||
|
// estData.parts_tax_rates?.PAR?.prt_tax_rt === null ||
|
||||||
|
// estData.parts_tax_rates?.PAR?.prt_tax_rt === 0
|
||||||
|
// ) {
|
||||||
|
// const res = await confirmDialog(
|
||||||
|
// `Rome Online has detected that there is a missing tax rate for recored parts. Pressing OK will set the tax rate to ${bodyshop.bill_tax_rates.state_tax_rate}% and enable the rate. Pressing cancel will keep the tax rate as is.`
|
||||||
|
// );
|
||||||
|
// if (res) {
|
||||||
|
// if (!estData.parts_tax_rates.PAR) {
|
||||||
|
// estData.parts_tax_rates.PAR = {
|
||||||
|
// prt_discp: 0,
|
||||||
|
// prt_mktyp: true,
|
||||||
|
// prt_mkupp: 0,
|
||||||
|
// prt_type: "PAR",
|
||||||
|
// };
|
||||||
|
// }
|
||||||
|
// estData.parts_tax_rates.PAR.prt_tax_rt =
|
||||||
|
// bodyshop.bill_tax_rates.state_tax_rate / 100;
|
||||||
|
// estData.parts_tax_rates.PAR.prt_tax_in = true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
//IO-1387 If a sublet line is NOT R&R, use the labor tax. If it is, use the sublet tax rate.
|
//IO-1387 If a sublet line is NOT R&R, use the labor tax. If it is, use the sublet tax rate.
|
||||||
//Currently limited to SK shops only.
|
//Currently limited to SK shops only.
|
||||||
//if (bodyshop.region_config === "CA_SK") {
|
if (bodyshop.region_config === "CA_SK") {
|
||||||
estData.joblines.data.forEach((jl, index) => {
|
estData.joblines.data.forEach((jl, index) => {
|
||||||
if (
|
if (
|
||||||
(jl.part_type === "PASL" || jl.part_type === "PAS") &&
|
(jl.part_type === "PASL" || jl.part_type === "PAS") &&
|
||||||
jl.lbr_op !== "OP11"
|
jl.lbr_op !== "OP11"
|
||||||
) {
|
) {
|
||||||
estData.joblines.data[index].tax_part = jl.lbr_tax;
|
estData.joblines.data[index].tax_part = jl.lbr_tax;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Set markup lines and tax lines as taxable.
|
//Set markup lines and tax lines as taxable.
|
||||||
//900510 is a mark up. 900510 is a discount.
|
//900510 is a mark up. 900510 is a discount.
|
||||||
if (jl.db_ref === "900510") {
|
if (jl.db_ref === "900510") {
|
||||||
estData.joblines.data[index].tax_part = true;
|
estData.joblines.data[index].tax_part = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function ResolveCCCLineIssues(estData, bodyshop) {
|
||||||
|
//Find all misc amounts, populate them to the act price.
|
||||||
|
//TODO Ensure that this doesnt get violated
|
||||||
|
//This needs to be done before cleansing unq_seq since some misc prices could move over.
|
||||||
|
estData.joblines.data.forEach((line) => {
|
||||||
|
if (line.misc_amt && line.misc_amt !== 0) {
|
||||||
|
line.act_price = line.act_price + line.misc_amt;
|
||||||
|
line.tax_part = !!line.misc_tax;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//}
|
|
||||||
|
//Generate the list of duplicated UNQ_SEQ that will feed into the next section to scrub the lines.
|
||||||
|
const unqSeqHash = _.groupBy(estData.joblines.data, "unq_seq");
|
||||||
|
const duplicatedUnqSeq = Object.keys(unqSeqHash).filter(
|
||||||
|
(key) => unqSeqHash[key].length > 1
|
||||||
|
);
|
||||||
|
|
||||||
|
duplicatedUnqSeq.forEach((unq_seq) => {
|
||||||
|
//Keys are strings, convert to int.
|
||||||
|
const int_unq_seq = parseInt(unq_seq);
|
||||||
|
|
||||||
|
//When line splitting, the first line is always the non-refinish line. We will keep it as is.
|
||||||
|
//We will cleanse the second line, which is always the next line.
|
||||||
|
const nonRefLineIndex = estData.joblines.data.findIndex(
|
||||||
|
(line) => line.unq_seq === int_unq_seq
|
||||||
|
);
|
||||||
|
estData.joblines.data[nonRefLineIndex + 1] = {
|
||||||
|
...estData.joblines.data[nonRefLineIndex + 1],
|
||||||
|
part_type: null,
|
||||||
|
act_price: 0,
|
||||||
|
db_price: 0,
|
||||||
|
prt_dsmk_p: 0,
|
||||||
|
prt_dsmk_m: 0,
|
||||||
|
};
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,6 +36,8 @@ export function JobsCloseAutoAllocate({ bodyshop, joblines, form, disabled }) {
|
|||||||
ret.profitcenter_part = defaults.profits["MAPA"];
|
ret.profitcenter_part = defaults.profits["MAPA"];
|
||||||
} else if (lineDesc.includes("ats amount")) {
|
} else if (lineDesc.includes("ats amount")) {
|
||||||
ret.profitcenter_part = defaults.profits["ATS"];
|
ret.profitcenter_part = defaults.profits["ATS"];
|
||||||
|
} else if (jl.act_price > 0) {
|
||||||
|
ret.profitcenter_part = defaults.profits["PAO"];
|
||||||
} else {
|
} else {
|
||||||
ret.profitcenter_part = null;
|
ret.profitcenter_part = null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,10 +9,12 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { auth, logImEXEvent } from "../../firebase/firebase.utils";
|
import { auth, logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
||||||
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
import { UPDATE_JOB } from "../../graphql/jobs.queries";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import {
|
import {
|
||||||
selectBodyshop,
|
selectBodyshop,
|
||||||
selectCurrentUser,
|
selectCurrentUser,
|
||||||
} from "../../redux/user/user.selectors";
|
} from "../../redux/user/user.selectors";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import client from "../../utils/GraphQLClient";
|
import client from "../../utils/GraphQLClient";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
@@ -20,6 +22,11 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
|
});
|
||||||
|
|
||||||
function updateJobCache(items) {
|
function updateJobCache(items) {
|
||||||
client.cache.modify({
|
client.cache.modify({
|
||||||
id: "ROOT_QUERY",
|
id: "ROOT_QUERY",
|
||||||
@@ -40,6 +47,7 @@ export function JobsCloseExportButton({
|
|||||||
disabled,
|
disabled,
|
||||||
setSelectedJobs,
|
setSelectedJobs,
|
||||||
refetch,
|
refetch,
|
||||||
|
insertAuditTrail,
|
||||||
}) {
|
}) {
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -181,6 +189,10 @@ export function JobsCloseExportButton({
|
|||||||
key: "jobsuccessexport",
|
key: "jobsuccessexport",
|
||||||
message: t("jobs.successes.exported"),
|
message: t("jobs.successes.exported"),
|
||||||
});
|
});
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: jobId,
|
||||||
|
operation: AuditTrailMapping.jobexported(),
|
||||||
|
});
|
||||||
updateJobCache(
|
updateJobCache(
|
||||||
jobUpdateResponse.data.update_jobs.returning.map((job) => job.id)
|
jobUpdateResponse.data.update_jobs.returning.map((job) => job.id)
|
||||||
);
|
);
|
||||||
@@ -192,12 +204,20 @@ export function JobsCloseExportButton({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo && successfulTransactions.length > 0) {
|
if (
|
||||||
|
bodyshop.accountingconfig &&
|
||||||
|
bodyshop.accountingconfig.qbo &&
|
||||||
|
successfulTransactions.length > 0
|
||||||
|
) {
|
||||||
notification.open({
|
notification.open({
|
||||||
type: "success",
|
type: "success",
|
||||||
key: "jobsuccessexport",
|
key: "jobsuccessexport",
|
||||||
message: t("jobs.successes.exported"),
|
message: t("jobs.successes.exported"),
|
||||||
});
|
});
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: jobId,
|
||||||
|
operation: AuditTrailMapping.jobexported(),
|
||||||
|
});
|
||||||
updateJobCache([
|
updateJobCache([
|
||||||
...new Set(
|
...new Set(
|
||||||
successfulTransactions.map(
|
successfulTransactions.map(
|
||||||
@@ -227,4 +247,7 @@ export function JobsCloseExportButton({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(mapStateToProps, null)(JobsCloseExportButton);
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(JobsCloseExportButton);
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Collapse, Form, Input, InputNumber, Select, Switch } from "antd";
|
import { Collapse, Form, Input, Select, Switch } 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";
|
||||||
@@ -12,6 +12,12 @@ import FormItemPhone, {
|
|||||||
} from "../form-items-formatted/phone-form-item.component";
|
} from "../form-items-formatted/phone-form-item.component";
|
||||||
import JobsDetailRatesChangeButton from "../jobs-detail-rates-change-button/jobs-detail-rates-change-button.component";
|
import JobsDetailRatesChangeButton from "../jobs-detail-rates-change-button/jobs-detail-rates-change-button.component";
|
||||||
import JobsDetailRatesParts from "../jobs-detail-rates/jobs-detail-rates.parts.component";
|
import JobsDetailRatesParts from "../jobs-detail-rates/jobs-detail-rates.parts.component";
|
||||||
|
|
||||||
|
import JobsDetailRatesLabor from "../jobs-detail-rates/jobs-detail-rates.labor.component";
|
||||||
|
import JobsDetailRatesMaterials from "../jobs-detail-rates/jobs-detail-rates.materials.component";
|
||||||
|
import JobsDetailRatesOther from "../jobs-detail-rates/jobs-detail-rates.other.component";
|
||||||
|
import JobsDetailRatesTaxes from "../jobs-detail-rates/jobs-detail-rates.taxes.component";
|
||||||
|
|
||||||
import JobsMarkPstExempt from "../jobs-mark-pst-exempt/jobs-mark-pst-exempt.component";
|
import JobsMarkPstExempt from "../jobs-mark-pst-exempt/jobs-mark-pst-exempt.component";
|
||||||
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
@@ -258,26 +264,28 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
|
|||||||
<CurrencyInput />
|
<CurrencyInput />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow>
|
{
|
||||||
<Form.Item
|
// <LayoutFormRow>
|
||||||
label={t("jobs.fields.federal_tax_rate")}
|
// <Form.Item
|
||||||
name="federal_tax_rate"
|
// label={t("jobs.fields.federal_tax_rate")}
|
||||||
>
|
// name="federal_tax_rate"
|
||||||
<InputNumber min={0} max={1} precision={2} />
|
// >
|
||||||
</Form.Item>
|
// <InputNumber min={0} max={1} precision={2} />
|
||||||
<Form.Item
|
// </Form.Item>
|
||||||
label={t("jobs.fields.state_tax_rate")}
|
// <Form.Item
|
||||||
name="state_tax_rate"
|
// label={t("jobs.fields.state_tax_rate")}
|
||||||
>
|
// name="state_tax_rate"
|
||||||
<InputNumber min={0} max={1} precision={2} />
|
// >
|
||||||
</Form.Item>
|
// <InputNumber min={0} max={1} precision={2} />
|
||||||
<Form.Item
|
// </Form.Item>
|
||||||
label={t("jobs.fields.local_tax_rate")}
|
// <Form.Item
|
||||||
name="local_tax_rate"
|
// label={t("jobs.fields.local_tax_rate")}
|
||||||
>
|
// name="local_tax_rate"
|
||||||
<InputNumber min={0} max={1} precision={2} />
|
// >
|
||||||
</Form.Item>
|
// <InputNumber min={0} max={1} precision={2} />
|
||||||
</LayoutFormRow>
|
// </Form.Item>
|
||||||
|
// </LayoutFormRow>
|
||||||
|
}
|
||||||
<LayoutFormRow>
|
<LayoutFormRow>
|
||||||
<Form.Item label={t("jobs.fields.rate_lab")} name="rate_lab">
|
<Form.Item label={t("jobs.fields.rate_lab")} name="rate_lab">
|
||||||
<CurrencyInput />
|
<CurrencyInput />
|
||||||
@@ -356,6 +364,10 @@ export function JobsCreateJobsInfo({ bodyshop, form, selected }) {
|
|||||||
required={selected && true}
|
required={selected && true}
|
||||||
form={form}
|
form={form}
|
||||||
/>
|
/>
|
||||||
|
<JobsDetailRatesLabor form={form} />
|
||||||
|
<JobsDetailRatesMaterials form={form} />
|
||||||
|
<JobsDetailRatesOther form={form} />
|
||||||
|
<JobsDetailRatesTaxes form={form} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,10 +19,13 @@ export default function JobsCreateOwnerInfoNewComponent() {
|
|||||||
label={t("owners.fields.ownr_ln")}
|
label={t("owners.fields.ownr_ln")}
|
||||||
name={["owner", "data", "ownr_ln"]}
|
name={["owner", "data", "ownr_ln"]}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
({ getFieldValue }) => ({
|
||||||
required: state.owner.new,
|
required:
|
||||||
|
state.owner.new &&
|
||||||
|
(!getFieldValue(["owner", "data", "ownr_co_nm"]) ||
|
||||||
|
getFieldValue(["owner", "data", "ownr_co_nm"]) === ""),
|
||||||
//message: t("general.validation.required"),
|
//message: t("general.validation.required"),
|
||||||
},
|
}),
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Input disabled={!state.owner.new} />
|
<Input disabled={!state.owner.new} />
|
||||||
@@ -31,10 +34,13 @@ export default function JobsCreateOwnerInfoNewComponent() {
|
|||||||
label={t("owners.fields.ownr_fn")}
|
label={t("owners.fields.ownr_fn")}
|
||||||
name={["owner", "data", "ownr_fn"]}
|
name={["owner", "data", "ownr_fn"]}
|
||||||
rules={[
|
rules={[
|
||||||
{
|
({ getFieldValue }) => ({
|
||||||
required: state.owner.new,
|
required:
|
||||||
|
state.owner.new &&
|
||||||
|
(!getFieldValue(["owner", "data", "ownr_co_nm"]) ||
|
||||||
|
getFieldValue(["owner", "data", "ownr_co_nm"]) === ""),
|
||||||
//message: t("general.validation.required"),
|
//message: t("general.validation.required"),
|
||||||
},
|
}),
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<Input disabled={!state.owner.new} />
|
<Input disabled={!state.owner.new} />
|
||||||
@@ -51,6 +57,17 @@ export default function JobsCreateOwnerInfoNewComponent() {
|
|||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("owners.fields.ownr_co_nm")}
|
label={t("owners.fields.ownr_co_nm")}
|
||||||
name={["owner", "data", "ownr_co_nm"]}
|
name={["owner", "data", "ownr_co_nm"]}
|
||||||
|
rules={[
|
||||||
|
({ getFieldValue }) => ({
|
||||||
|
required:
|
||||||
|
state.owner.new &&
|
||||||
|
(!getFieldValue(["owner", "data", "ownr_ln"]) ||
|
||||||
|
!getFieldValue(["owner", "data", "ownr_fn"]) ||
|
||||||
|
getFieldValue(["owner", "data", "ownr_ln"]) === "" ||
|
||||||
|
getFieldValue(["owner", "data", "ownr_fn"]) === ""),
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
}),
|
||||||
|
]}
|
||||||
>
|
>
|
||||||
<Input disabled={!state.owner.new} />
|
<Input disabled={!state.owner.new} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ const mapDispatchToProps = (dispatch) => ({
|
|||||||
dispatch(setModalContext({ context: context, modal: "jobCosting" })),
|
dispatch(setModalContext({ context: context, modal: "jobCosting" })),
|
||||||
setTimeTicketContext: (context) =>
|
setTimeTicketContext: (context) =>
|
||||||
dispatch(setModalContext({ context: context, modal: "timeTicket" })),
|
dispatch(setModalContext({ context: context, modal: "timeTicket" })),
|
||||||
|
setTimeTicketTaskContext: (context) =>
|
||||||
|
dispatch(setModalContext({ context: context, modal: "timeTicketTask" })),
|
||||||
setCardPaymentContext: (context) =>
|
setCardPaymentContext: (context) =>
|
||||||
dispatch(setModalContext({ context: context, modal: "cardPayment" })),
|
dispatch(setModalContext({ context: context, modal: "cardPayment" })),
|
||||||
insertAuditTrail: ({ jobid, operation }) =>
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
@@ -67,6 +69,7 @@ export function JobsDetailHeaderActions({
|
|||||||
setJobCostingContext,
|
setJobCostingContext,
|
||||||
jobRO,
|
jobRO,
|
||||||
setTimeTicketContext,
|
setTimeTicketContext,
|
||||||
|
setTimeTicketTaskContext,
|
||||||
setCardPaymentContext,
|
setCardPaymentContext,
|
||||||
insertAuditTrail,
|
insertAuditTrail,
|
||||||
}) {
|
}) {
|
||||||
@@ -129,6 +132,12 @@ export function JobsDetailHeaderActions({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: job.id,
|
||||||
|
operation: AuditTrailMapping.jobsuspend(
|
||||||
|
!!job.suspended ? !job.suspended : true
|
||||||
|
),
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
const statusmenu = (
|
const statusmenu = (
|
||||||
@@ -276,6 +285,24 @@ export function JobsDetailHeaderActions({
|
|||||||
>
|
>
|
||||||
{t("timetickets.actions.enter")}
|
{t("timetickets.actions.enter")}
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
|
{bodyshop.md_tasks_presets.enable_tasks && (
|
||||||
|
<Menu.Item
|
||||||
|
key="claimtimetickettasks"
|
||||||
|
disabled={
|
||||||
|
!job.converted ||
|
||||||
|
(!bodyshop.tt_allow_post_to_invoiced && job.date_invoiced)
|
||||||
|
}
|
||||||
|
onClick={() => {
|
||||||
|
setTimeTicketTaskContext({
|
||||||
|
actions: {},
|
||||||
|
context: { jobid: job.id },
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("timetickets.actions.claimtasks")}
|
||||||
|
</Menu.Item>
|
||||||
|
)}
|
||||||
|
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
key="enterpayments"
|
key="enterpayments"
|
||||||
disabled={!job.converted}
|
disabled={!job.converted}
|
||||||
@@ -540,6 +567,10 @@ export function JobsDetailHeaderActions({
|
|||||||
notification["success"]({
|
notification["success"]({
|
||||||
message: t("jobs.successes.voided"),
|
message: t("jobs.successes.voided"),
|
||||||
});
|
});
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: job.id,
|
||||||
|
operation: AuditTrailMapping.jobvoid(),
|
||||||
|
});
|
||||||
//go back to jobs list.
|
//go back to jobs list.
|
||||||
history.push(`/manage/`);
|
history.push(`/manage/`);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { setModalContext } from "../../redux/modals/modals.actions";
|
|||||||
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 { DateTimeFormatter } from "../../utils/DateFormatter";
|
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
|
import PhoneNumberFormatter from "../../utils/PhoneFormatter";
|
||||||
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
|
import ChatOpenButton from "../chat-open-button/chat-open-button.component";
|
||||||
import DataLabel from "../data-label/data-label.component";
|
import DataLabel from "../data-label/data-label.component";
|
||||||
import JobAltTransportChange from "../job-at-change/job-at-change.component";
|
import JobAltTransportChange from "../job-at-change/job-at-change.component";
|
||||||
@@ -122,20 +123,23 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
</DataLabel>
|
</DataLabel>
|
||||||
{job.cccontracts.length > 0 && (
|
{job.cccontracts.length > 0 && (
|
||||||
<DataLabel label={t("jobs.labels.contracts")}>
|
<DataLabel label={t("jobs.labels.contracts")}>
|
||||||
{job.cccontracts.map((c) => (
|
{job.cccontracts.map((c, index) => (
|
||||||
<Link
|
<Space wrap>
|
||||||
key={c.id}
|
<Link
|
||||||
to={`/manage/courtesycars/contracts/${c.id}`}
|
key={c.id}
|
||||||
>{`${c.agreementnumber} - ${c.courtesycar.fleetnumber} ${c.courtesycar.year} ${c.courtesycar.make} ${c.courtesycar.model}`}</Link>
|
to={`/manage/courtesycars/contracts/${c.id}`}
|
||||||
|
>
|
||||||
|
{`${c.agreementnumber} - ${c.courtesycar.fleetnumber} ${c.courtesycar.year} ${c.courtesycar.make} ${c.courtesycar.model}`}
|
||||||
|
{index !== job.cccontracts.length - 1 ? "," : null}
|
||||||
|
</Link>
|
||||||
|
</Space>
|
||||||
))}
|
))}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<DataLabel label={t("jobs.fields.production_vars.note")}>
|
<DataLabel label={t("jobs.fields.production_vars.note")}>
|
||||||
<ProductionListColumnProductionNote record={job} />
|
<ProductionListColumnProductionNote record={job} />
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
|
<Space wrap>
|
||||||
<Space>
|
|
||||||
{job.special_coverage_policy && (
|
{job.special_coverage_policy && (
|
||||||
<Tag color="tomato">
|
<Tag color="tomato">
|
||||||
<Space>
|
<Space>
|
||||||
@@ -160,19 +164,35 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
<Card
|
<Card
|
||||||
style={{ height: "100%" }}
|
style={{ height: "100%" }}
|
||||||
title={
|
title={
|
||||||
<Link to={disabled ? "#" : `/manage/owners/${job.owner.id}`}>
|
disabled ? (
|
||||||
{ownerTitle.length > 0
|
<>
|
||||||
? ownerTitle
|
{ownerTitle.length > 0
|
||||||
: t("owner.labels.noownerinfo")}
|
? ownerTitle
|
||||||
</Link>
|
: t("owner.labels.noownerinfo")}
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<Link to={`/manage/owners/${job.owner.id}`}>
|
||||||
|
{ownerTitle.length > 0
|
||||||
|
? ownerTitle
|
||||||
|
: t("owner.labels.noownerinfo")}
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<DataLabel key="2" label={t("jobs.fields.ownr_ph1")}>
|
<DataLabel key="2" label={t("jobs.fields.ownr_ph1")}>
|
||||||
<ChatOpenButton phone={job.ownr_ph1} jobid={job.id} />
|
{disabled ? (
|
||||||
|
<PhoneNumberFormatter>{job.ownr_ph1}</PhoneNumberFormatter>
|
||||||
|
) : (
|
||||||
|
<ChatOpenButton phone={job.ownr_ph1} jobid={job.id} />
|
||||||
|
)}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
<DataLabel key="22" label={t("jobs.fields.ownr_ph2")}>
|
<DataLabel key="22" label={t("jobs.fields.ownr_ph2")}>
|
||||||
<ChatOpenButton phone={job.ownr_ph2} jobid={job.id} />
|
{disabled ? (
|
||||||
|
<PhoneNumberFormatter>{job.ownr_ph2}</PhoneNumberFormatter>
|
||||||
|
) : (
|
||||||
|
<ChatOpenButton phone={job.ownr_ph2} jobid={job.id} />
|
||||||
|
)}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
<DataLabel key="3" label={t("owners.fields.address")}>
|
<DataLabel key="3" label={t("owners.fields.address")}>
|
||||||
{`${job.ownr_addr1 || ""} ${job.ownr_addr2 || ""} ${
|
{`${job.ownr_addr1 || ""} ${job.ownr_addr2 || ""} ${
|
||||||
@@ -180,7 +200,11 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
} ${job.ownr_st || ""} ${job.ownr_zip || ""}`}
|
} ${job.ownr_st || ""} ${job.ownr_zip || ""}`}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
<DataLabel key="4" label={t("owners.fields.ownr_ea")}>
|
<DataLabel key="4" label={t("owners.fields.ownr_ea")}>
|
||||||
{job.ownr_ea || ""}
|
{disabled ? (
|
||||||
|
<>{job.ownr_ea || ""}</>
|
||||||
|
) : job.ownr_ea ? (
|
||||||
|
<a href={`mailto:${job.ownr_ea}`}>{job.ownr_ea}</a>
|
||||||
|
) : null}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
{job.owner?.tax_number && (
|
{job.owner?.tax_number && (
|
||||||
<DataLabel key="5" label={t("owners.fields.tax_number")}>
|
<DataLabel key="5" label={t("owners.fields.tax_number")}>
|
||||||
@@ -195,17 +219,19 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
style={{ height: "100%" }}
|
style={{ height: "100%" }}
|
||||||
title={
|
title={
|
||||||
job.vehicle ? (
|
job.vehicle ? (
|
||||||
<Link
|
disabled ? (
|
||||||
to={
|
<>
|
||||||
disabled
|
{vehicleTitle.length > 0
|
||||||
? "#"
|
? vehicleTitle
|
||||||
: job.vehicle && `/manage/vehicles/${job.vehicle.id}`
|
: t("vehicles.labels.novehinfo")}{" "}
|
||||||
}
|
</>
|
||||||
>
|
) : (
|
||||||
{vehicleTitle.length > 0
|
<Link to={job.vehicle && `/manage/vehicles/${job.vehicle.id}`}>
|
||||||
? vehicleTitle
|
{vehicleTitle.length > 0
|
||||||
: t("vehicles.labels.novehinfo")}
|
? vehicleTitle
|
||||||
</Link>
|
: t("vehicles.labels.novehinfo")}
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
) : (
|
) : (
|
||||||
<span></span>
|
<span></span>
|
||||||
)
|
)
|
||||||
@@ -221,12 +247,19 @@ export function JobsDetailHeader({ job, bodyshop, disabled }) {
|
|||||||
<VehicleVinDisplay>
|
<VehicleVinDisplay>
|
||||||
{`${job.v_vin || t("general.labels.na")}`}
|
{`${job.v_vin || t("general.labels.na")}`}
|
||||||
</VehicleVinDisplay>
|
</VehicleVinDisplay>
|
||||||
|
{bodyshop.pbs_serialnumber || bodyshop.cdk_dealerid ? (
|
||||||
|
job.v_vin?.length !== 17 ? (
|
||||||
|
<WarningFilled
|
||||||
|
style={{ color: "tomato", marginLeft: ".3rem" }}
|
||||||
|
/>
|
||||||
|
) : null
|
||||||
|
) : null}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
<DataLabel label={t("jobs.fields.regie_number")}>
|
<DataLabel label={t("jobs.fields.regie_number")}>
|
||||||
{job.regie_number || t("general.labels.na")}
|
{job.regie_number || t("general.labels.na")}
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
<DataLabel label={t("jobs.labels.relatedros")}>
|
<DataLabel label={t("jobs.labels.relatedros")}>
|
||||||
<JobsRelatedRos jobid={job.id} job={job} />
|
<JobsRelatedRos jobid={job.id} job={job} disabled={disabled} />
|
||||||
</DataLabel>
|
</DataLabel>
|
||||||
{job.vehicle && job.vehicle.notes && (
|
{job.vehicle && job.vehicle.notes && (
|
||||||
<DataLabel
|
<DataLabel
|
||||||
|
|||||||
@@ -5,9 +5,13 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
import LaborAllocationsTableComponent from "../labor-allocations-table/labor-allocations-table.component";
|
import LaborAllocationsTableComponent from "../labor-allocations-table/labor-allocations-table.component";
|
||||||
import TimeTicketList from "../time-ticket-list/time-ticket-list.component";
|
import TimeTicketList from "../time-ticket-list/time-ticket-list.component";
|
||||||
|
import PayrollLaborAllocationsTable from "../labor-allocations-table/labor-allocations-table.payroll.component";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import { useTreatments } from "@splitsoftware/splitio-react";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default connect(mapStateToProps, null)(JobsDetailLaborContainer);
|
export default connect(mapStateToProps, null)(JobsDetailLaborContainer);
|
||||||
@@ -48,6 +52,7 @@ const adjSpan = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export function JobsDetailLaborContainer({
|
export function JobsDetailLaborContainer({
|
||||||
|
bodyshop,
|
||||||
jobRO,
|
jobRO,
|
||||||
job,
|
job,
|
||||||
jobId,
|
jobId,
|
||||||
@@ -58,6 +63,12 @@ export function JobsDetailLaborContainer({
|
|||||||
techConsole,
|
techConsole,
|
||||||
adjustments,
|
adjustments,
|
||||||
}) {
|
}) {
|
||||||
|
const { Enhanced_Payroll } = useTreatments(
|
||||||
|
["Enhanced_Payroll"],
|
||||||
|
{},
|
||||||
|
bodyshop.imexshopid
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Row gutter={[16, 16]}>
|
<Row gutter={[16, 16]}>
|
||||||
<Col {...ticketSpan}>
|
<Col {...ticketSpan}>
|
||||||
@@ -70,14 +81,28 @@ export function JobsDetailLaborContainer({
|
|||||||
jobId={jobId}
|
jobId={jobId}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
<Col {...adjSpan}>
|
|
||||||
<LaborAllocationsTableComponent
|
{Enhanced_Payroll.treatment === "on" ? (
|
||||||
jobId={jobId}
|
<Col {...adjSpan}>
|
||||||
joblines={joblines}
|
<PayrollLaborAllocationsTable
|
||||||
timetickets={timetickets}
|
jobId={jobId}
|
||||||
adjustments={adjustments}
|
joblines={joblines}
|
||||||
/>
|
timetickets={timetickets}
|
||||||
</Col>
|
refetch={refetch}
|
||||||
|
adjustments={adjustments}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
) : (
|
||||||
|
<Col {...adjSpan}>
|
||||||
|
<LaborAllocationsTableComponent
|
||||||
|
jobId={jobId}
|
||||||
|
joblines={joblines}
|
||||||
|
timetickets={timetickets}
|
||||||
|
refetch={refetch}
|
||||||
|
adjustments={adjustments}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,12 +6,14 @@ import BillsListTable from "../bills-list-table/bills-list-table.component";
|
|||||||
import JobBillsTotal from "../job-bills-total/job-bills-total.component";
|
import JobBillsTotal from "../job-bills-total/job-bills-total.component";
|
||||||
import PartsOrderListTableComponent from "../parts-order-list-table/parts-order-list-table.component";
|
import PartsOrderListTableComponent from "../parts-order-list-table/parts-order-list-table.component";
|
||||||
import PartsOrderModal from "../parts-order-modal/parts-order-modal.container";
|
import PartsOrderModal from "../parts-order-modal/parts-order-modal.container";
|
||||||
|
import PartsDispatchTable from "../parts-dispatch-table/parts-dispatch-table.component";
|
||||||
|
|
||||||
export default function JobsDetailPliComponent({
|
export default function JobsDetailPliComponent({
|
||||||
job,
|
job,
|
||||||
billsQuery,
|
billsQuery,
|
||||||
handleBillOnRowClick,
|
handleBillOnRowClick,
|
||||||
handlePartsOrderOnRowClick,
|
handlePartsOrderOnRowClick,
|
||||||
|
handlePartsDispatchOnRowClick,
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
@@ -43,6 +45,13 @@ export default function JobsDetailPliComponent({
|
|||||||
billsQuery={billsQuery}
|
billsQuery={billsQuery}
|
||||||
/>
|
/>
|
||||||
</Col>
|
</Col>
|
||||||
|
<Col span={24}>
|
||||||
|
<PartsDispatchTable
|
||||||
|
job={job}
|
||||||
|
handleOnRowClick={handlePartsDispatchOnRowClick}
|
||||||
|
billsQuery={billsQuery}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -39,12 +39,24 @@ export default function JobsDetailPliContainer({ job }) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handlePartsDispatchOnRowClick = (record) => {
|
||||||
|
if (record) {
|
||||||
|
if (record.id) {
|
||||||
|
search.partsdispatchid = record.id;
|
||||||
|
history.push({ search: queryString.stringify(search) });
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
delete search.partsdispatchid;
|
||||||
|
history.push({ search: queryString.stringify(search) });
|
||||||
|
}
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<JobsDetailPliComponent
|
<JobsDetailPliComponent
|
||||||
job={job}
|
job={job}
|
||||||
billsQuery={billsQuery}
|
billsQuery={billsQuery}
|
||||||
handleBillOnRowClick={handleBillOnRowClick}
|
handleBillOnRowClick={handleBillOnRowClick}
|
||||||
handlePartsOrderOnRowClick={handlePartsOrderOnRowClick}
|
handlePartsOrderOnRowClick={handlePartsOrderOnRowClick}
|
||||||
|
handlePartsDispatchOnRowClick={handlePartsDispatchOnRowClick}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,25 +1,21 @@
|
|||||||
import {
|
import { Divider, Form, Input, Select, Space, Switch, Tooltip } from "antd";
|
||||||
Divider,
|
|
||||||
Form,
|
|
||||||
Input,
|
|
||||||
InputNumber,
|
|
||||||
Select,
|
|
||||||
Space,
|
|
||||||
Switch,
|
|
||||||
Tooltip,
|
|
||||||
} 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";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import CABCpvrtCalculator from "../ca-bc-pvrt-calculator/ca-bc-pvrt-calculator.component";
|
|
||||||
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
import CurrencyInput from "../form-items-formatted/currency-form-item.component";
|
||||||
import JobsDetailRatesChangeButton from "../jobs-detail-rates-change-button/jobs-detail-rates-change-button.component";
|
import JobsDetailRatesChangeButton from "../jobs-detail-rates-change-button/jobs-detail-rates-change-button.component";
|
||||||
import JobsMarkPstExempt from "../jobs-mark-pst-exempt/jobs-mark-pst-exempt.component";
|
import JobsMarkPstExempt from "../jobs-mark-pst-exempt/jobs-mark-pst-exempt.component";
|
||||||
import FormRow from "../layout-form-row/layout-form-row.component";
|
import FormRow from "../layout-form-row/layout-form-row.component";
|
||||||
|
import JobsDetailRatesLabor from "./jobs-detail-rates.labor.component";
|
||||||
|
import JobsDetailRatesMaterials from "./jobs-detail-rates.materials.component";
|
||||||
|
import JobsDetailRatesOther from "./jobs-detail-rates.other.component";
|
||||||
import JobsDetailRatesParts from "./jobs-detail-rates.parts.component";
|
import JobsDetailRatesParts from "./jobs-detail-rates.parts.component";
|
||||||
|
import JobsDetailRatesTaxes from "./jobs-detail-rates.taxes.component";
|
||||||
|
import JobsDetailRatesProfileOVerride from "./jobs-detail-rates.profile-override.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
jobRO: selectJobReadOnly,
|
jobRO: selectJobReadOnly,
|
||||||
@@ -84,14 +80,7 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
|
|||||||
>
|
>
|
||||||
<CurrencyInput disabled={jobRO || bodyshop.cdk_dealerid} />
|
<CurrencyInput disabled={jobRO || bodyshop.cdk_dealerid} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
{bodyshop.region_config === "CA_BC" && (
|
|
||||||
<Space align="center">
|
|
||||||
<Form.Item label={t("jobs.fields.ca_bc_pvrt")} name="ca_bc_pvrt">
|
|
||||||
<CurrencyInput disabled={jobRO} min={0} />
|
|
||||||
</Form.Item>
|
|
||||||
<CABCpvrtCalculator form={form} disabled={jobRO} />
|
|
||||||
</Space>
|
|
||||||
)}
|
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.auto_add_ats")}
|
label={t("jobs.fields.auto_add_ats")}
|
||||||
name="auto_add_ats"
|
name="auto_add_ats"
|
||||||
@@ -120,41 +109,7 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
|
|||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
<FormRow>
|
|
||||||
<Form.Item
|
|
||||||
label={t("jobs.fields.federal_tax_rate")}
|
|
||||||
name="federal_tax_rate"
|
|
||||||
>
|
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("jobs.fields.state_tax_rate")}
|
|
||||||
name="state_tax_rate"
|
|
||||||
>
|
|
||||||
<InputNumber
|
|
||||||
min={0}
|
|
||||||
max={1}
|
|
||||||
precision={2}
|
|
||||||
disabled={jobRO}
|
|
||||||
autoComplete="new-password"
|
|
||||||
/>
|
|
||||||
</Form.Item>
|
|
||||||
<Form.Item
|
|
||||||
label={t("jobs.fields.local_tax_rate")}
|
|
||||||
name="local_tax_rate"
|
|
||||||
>
|
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
|
||||||
</Form.Item>
|
|
||||||
{bodyshop.region_config.toLowerCase().startsWith("ca") && (
|
|
||||||
<Form.Item
|
|
||||||
label={t("jobs.fields.ca_gst_registrant")}
|
|
||||||
name="ca_gst_registrant"
|
|
||||||
valuePropName="checked"
|
|
||||||
>
|
|
||||||
<Switch disabled={jobRO} />
|
|
||||||
</Form.Item>
|
|
||||||
)}
|
|
||||||
</FormRow>
|
|
||||||
<Divider
|
<Divider
|
||||||
orientation="left"
|
orientation="left"
|
||||||
type="horizontal"
|
type="horizontal"
|
||||||
@@ -242,7 +197,15 @@ export function JobsDetailRates({ jobRO, form, job, bodyshop }) {
|
|||||||
<CurrencyInput min={0} disabled={jobRO} />
|
<CurrencyInput min={0} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</FormRow>
|
</FormRow>
|
||||||
|
<Divider orientation="left">Tax Profile</Divider>
|
||||||
|
|
||||||
|
<JobsDetailRatesProfileOVerride form={form} />
|
||||||
|
|
||||||
<JobsDetailRatesParts form={form} />
|
<JobsDetailRatesParts form={form} />
|
||||||
|
<JobsDetailRatesLabor form={form} />
|
||||||
|
<JobsDetailRatesMaterials form={form} />
|
||||||
|
<JobsDetailRatesOther form={form} />
|
||||||
|
<JobsDetailRatesTaxes form={form} />
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,427 @@
|
|||||||
|
import { Collapse, Form, Switch } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
});
|
||||||
|
|
||||||
|
export function JobsDetailRatesLabor({
|
||||||
|
jobRO,
|
||||||
|
expanded,
|
||||||
|
required = true,
|
||||||
|
form,
|
||||||
|
}) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Collapse defaultActiveKey={expanded && "rates"}>
|
||||||
|
<Collapse.Panel
|
||||||
|
forceRender
|
||||||
|
header={t("jobs.labels.cieca_pfl")}
|
||||||
|
key="cieca_pfl"
|
||||||
|
>
|
||||||
|
<LayoutFormRow header={t("joblines.fields.lbr_types.LAB")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tax_in")}
|
||||||
|
name={["cieca_pfl", "LAB", "lbr_tax_in"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in1")}
|
||||||
|
name={["cieca_pfl", "LAB", "lbr_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in2")}
|
||||||
|
name={["cieca_pfl", "LAB", "lbr_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in3")}
|
||||||
|
name={["cieca_pfl", "LAB", "lbr_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in4")}
|
||||||
|
name={["cieca_pfl", "LAB", "lbr_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in5")}
|
||||||
|
name={["cieca_pfl", "LAB", "lbr_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow header={t("joblines.fields.lbr_types.LAD")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tax_in")}
|
||||||
|
name={["cieca_pfl", "LAD", "lbr_tax_in"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in1")}
|
||||||
|
name={["cieca_pfl", "LAD", "lbr_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in2")}
|
||||||
|
name={["cieca_pfl", "LAD", "lbr_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in3")}
|
||||||
|
name={["cieca_pfl", "LAD", "lbr_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in4")}
|
||||||
|
name={["cieca_pfl", "LAD", "lbr_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in5")}
|
||||||
|
name={["cieca_pfl", "LAD", "lbr_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow header={t("joblines.fields.lbr_types.LAE")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tax_in")}
|
||||||
|
name={["cieca_pfl", "LAE", "lbr_tax_in"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in1")}
|
||||||
|
name={["cieca_pfl", "LAE", "lbr_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in2")}
|
||||||
|
name={["cieca_pfl", "LAE", "lbr_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in3")}
|
||||||
|
name={["cieca_pfl", "LAE", "lbr_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in4")}
|
||||||
|
name={["cieca_pfl", "LAE", "lbr_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in5")}
|
||||||
|
name={["cieca_pfl", "LAE", "lbr_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow header={t("joblines.fields.lbr_types.LAF")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tax_in")}
|
||||||
|
name={["cieca_pfl", "LAF", "lbr_tax_in"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in1")}
|
||||||
|
name={["cieca_pfl", "LAF", "lbr_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in2")}
|
||||||
|
name={["cieca_pfl", "LAF", "lbr_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in3")}
|
||||||
|
name={["cieca_pfl", "LAF", "lbr_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in4")}
|
||||||
|
name={["cieca_pfl", "LAF", "lbr_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in5")}
|
||||||
|
name={["cieca_pfl", "LAF", "lbr_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow header={t("joblines.fields.lbr_types.LAG")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tax_in")}
|
||||||
|
name={["cieca_pfl", "LAG", "lbr_tax_in"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in1")}
|
||||||
|
name={["cieca_pfl", "LAG", "lbr_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in2")}
|
||||||
|
name={["cieca_pfl", "LAG", "lbr_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in3")}
|
||||||
|
name={["cieca_pfl", "LAG", "lbr_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in4")}
|
||||||
|
name={["cieca_pfl", "LAG", "lbr_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in5")}
|
||||||
|
name={["cieca_pfl", "LAG", "lbr_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow header={t("joblines.fields.lbr_types.LAM")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tax_in")}
|
||||||
|
name={["cieca_pfl", "LAM", "lbr_tax_in"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in1")}
|
||||||
|
name={["cieca_pfl", "LAM", "lbr_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in2")}
|
||||||
|
name={["cieca_pfl", "LAM", "lbr_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in3")}
|
||||||
|
name={["cieca_pfl", "LAM", "lbr_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in4")}
|
||||||
|
name={["cieca_pfl", "LAM", "lbr_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in5")}
|
||||||
|
name={["cieca_pfl", "LAM", "lbr_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow header={t("joblines.fields.lbr_types.LAR")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tax_in")}
|
||||||
|
name={["cieca_pfl", "LAR", "lbr_tax_in"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in1")}
|
||||||
|
name={["cieca_pfl", "LAR", "lbr_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in2")}
|
||||||
|
name={["cieca_pfl", "LAR", "lbr_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in3")}
|
||||||
|
name={["cieca_pfl", "LAR", "lbr_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in4")}
|
||||||
|
name={["cieca_pfl", "LAR", "lbr_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in5")}
|
||||||
|
name={["cieca_pfl", "LAR", "lbr_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow header={t("joblines.fields.lbr_types.LAS")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tax_in")}
|
||||||
|
name={["cieca_pfl", "LAS", "lbr_tax_in"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in1")}
|
||||||
|
name={["cieca_pfl", "LAS", "lbr_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in2")}
|
||||||
|
name={["cieca_pfl", "LAS", "lbr_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in3")}
|
||||||
|
name={["cieca_pfl", "LAS", "lbr_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in4")}
|
||||||
|
name={["cieca_pfl", "LAS", "lbr_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in5")}
|
||||||
|
name={["cieca_pfl", "LAS", "lbr_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow header={t("joblines.fields.lbr_types.LAU")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tax_in")}
|
||||||
|
name={["cieca_pfl", "LAU", "lbr_tax_in"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in1")}
|
||||||
|
name={["cieca_pfl", "LAU", "lbr_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in2")}
|
||||||
|
name={["cieca_pfl", "LAU", "lbr_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in3")}
|
||||||
|
name={["cieca_pfl", "LAU", "lbr_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in4")}
|
||||||
|
name={["cieca_pfl", "LAU", "lbr_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfl.lbr_tx_in5")}
|
||||||
|
name={["cieca_pfl", "LAU", "lbr_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
</Collapse.Panel>
|
||||||
|
</Collapse>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default connect(mapStateToProps, null)(JobsDetailRatesLabor);
|
||||||
@@ -0,0 +1,145 @@
|
|||||||
|
import { Collapse, Form, Input, InputNumber, Switch } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
});
|
||||||
|
|
||||||
|
export function JobsDetailRatesMaterials({
|
||||||
|
jobRO,
|
||||||
|
expanded,
|
||||||
|
required = true,
|
||||||
|
form,
|
||||||
|
}) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Collapse defaultActiveKey={expanded && "rates"}>
|
||||||
|
<Collapse.Panel
|
||||||
|
forceRender
|
||||||
|
header={t("jobs.fields.materials.materials")}
|
||||||
|
key="materials"
|
||||||
|
>
|
||||||
|
<LayoutFormRow header={t("jobs.fields.materials.MAPA")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.cal_maxdlr")}
|
||||||
|
name={["materials", "MAPA", "cal_maxdlr"]}
|
||||||
|
>
|
||||||
|
<InputNumber min={0} precision={2} disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.cal_opcode")}
|
||||||
|
name={["materials", "MAPA", "cal_opcode"]}
|
||||||
|
>
|
||||||
|
<Input disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.tax_ind")}
|
||||||
|
name={["materials", "MAPA", "tax_ind"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.mat_tx_in1")}
|
||||||
|
name={["materials", "MAPA", "mat_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.mat_tx_in2")}
|
||||||
|
name={["materials", "MAPA", "mat_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.mat_tx_in3")}
|
||||||
|
name={["materials", "MAPA", "mat_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.mat_tx_in4")}
|
||||||
|
name={["materials", "MAPA", "mat_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.mat_tx_in5")}
|
||||||
|
name={["materials", "MAPA", "mat_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
<LayoutFormRow header={t("jobs.fields.materials.MASH")}>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.cal_maxdlr")}
|
||||||
|
name={["materials", "MASH", "cal_maxdlr"]}
|
||||||
|
>
|
||||||
|
<InputNumber min={0} precision={2} disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.cal_opcode")}
|
||||||
|
name={["materials", "MASH", "cal_opcode"]}
|
||||||
|
>
|
||||||
|
<Input disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.tax_ind")}
|
||||||
|
name={["materials", "MASH", "tax_ind"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.mat_tx_in1")}
|
||||||
|
name={["materials", "MASH", "mat_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.mat_tx_in2")}
|
||||||
|
name={["materials", "MASH", "mat_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.mat_tx_in3")}
|
||||||
|
name={["materials", "MASH", "mat_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.mat_tx_in4")}
|
||||||
|
name={["materials", "MASH", "mat_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.materials.mat_tx_in5")}
|
||||||
|
name={["materials", "MASH", "mat_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
</Collapse.Panel>
|
||||||
|
</Collapse>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default connect(mapStateToProps, null)(JobsDetailRatesMaterials);
|
||||||
@@ -0,0 +1,104 @@
|
|||||||
|
import { Collapse, Form, Switch } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
|
import LayoutFormRow from "../layout-form-row/layout-form-row.component";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
});
|
||||||
|
|
||||||
|
export function JobsDetailRatesOther({
|
||||||
|
jobRO,
|
||||||
|
expanded,
|
||||||
|
required = true,
|
||||||
|
form,
|
||||||
|
}) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Collapse defaultActiveKey={expanded && "rates"}>
|
||||||
|
<Collapse.Panel
|
||||||
|
forceRender
|
||||||
|
header={t("jobs.labels.cieca_pfo")}
|
||||||
|
key="cieca_pfo"
|
||||||
|
>
|
||||||
|
<LayoutFormRow noDivider>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfo.tow_t_in1")}
|
||||||
|
name={["cieca_pfo", "tow_t_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfo.tow_t_in2")}
|
||||||
|
name={["cieca_pfo", "tow_t_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfo.tow_t_in3")}
|
||||||
|
name={["cieca_pfo", "tow_t_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfo.tow_t_in4")}
|
||||||
|
name={["cieca_pfo", "tow_t_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfo.tow_t_in5")}
|
||||||
|
name={["cieca_pfo", "tow_t_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfo.stor_t_in1")}
|
||||||
|
name={["cieca_pfo", "stor_t_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfo.stor_t_in2")}
|
||||||
|
name={["cieca_pfo", "stor_t_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfo.stor_t_in3")}
|
||||||
|
name={["cieca_pfo", "stor_t_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfo.stor_t_in4")}
|
||||||
|
name={["cieca_pfo", "stor_t_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.cieca_pfo.stor_t_in5")}
|
||||||
|
name={["cieca_pfo", "stor_t_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
</LayoutFormRow>
|
||||||
|
</Collapse.Panel>
|
||||||
|
</Collapse>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default connect(mapStateToProps, null)(JobsDetailRatesOther);
|
||||||
@@ -29,7 +29,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "PAA", "prt_discp"]}
|
name={["parts_tax_rates", "PAA", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -42,7 +42,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "PAA", "prt_mkupp"]}
|
name={["parts_tax_rates", "PAA", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -68,18 +68,58 @@ export function JobsDetailRatesParts({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
precision={4}
|
||||||
|
disabled={jobRO}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in1")}
|
||||||
|
name={["parts_tax_rates", "PAA", "prt_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in2")}
|
||||||
|
name={["parts_tax_rates", "PAA", "prt_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in3")}
|
||||||
|
name={["parts_tax_rates", "PAA", "prt_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in4")}
|
||||||
|
name={["parts_tax_rates", "PAA", "prt_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in5")}
|
||||||
|
name={["parts_tax_rates", "PAA", "prt_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.PAC")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.PAC")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "PAC", "prt_discp"]}
|
name={["parts_tax_rates", "PAC", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -92,7 +132,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "PAC", "prt_mkupp"]}
|
name={["parts_tax_rates", "PAC", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -118,18 +158,58 @@ export function JobsDetailRatesParts({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
precision={4}
|
||||||
|
disabled={jobRO}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in1")}
|
||||||
|
name={["parts_tax_rates", "PAC", "prt_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in2")}
|
||||||
|
name={["parts_tax_rates", "PAC", "prt_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in3")}
|
||||||
|
name={["parts_tax_rates", "PAC", "prt_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in4")}
|
||||||
|
name={["parts_tax_rates", "PAC", "prt_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in5")}
|
||||||
|
name={["parts_tax_rates", "PAC", "prt_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.PAL")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.PAL")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "PAL", "prt_discp"]}
|
name={["parts_tax_rates", "PAL", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -142,7 +222,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "PAL", "prt_mkupp"]}
|
name={["parts_tax_rates", "PAL", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -168,18 +248,58 @@ export function JobsDetailRatesParts({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
precision={4}
|
||||||
|
disabled={jobRO}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in1")}
|
||||||
|
name={["parts_tax_rates", "PAL", "prt_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in2")}
|
||||||
|
name={["parts_tax_rates", "PAL", "prt_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in3")}
|
||||||
|
name={["parts_tax_rates", "PAL", "prt_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in4")}
|
||||||
|
name={["parts_tax_rates", "PAL", "prt_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in5")}
|
||||||
|
name={["parts_tax_rates", "PAL", "prt_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.PAG")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.PAG")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "PAG", "prt_discp"]}
|
name={["parts_tax_rates", "PAG", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -192,7 +312,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "PAG", "prt_mkupp"]}
|
name={["parts_tax_rates", "PAG", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -218,18 +338,58 @@ export function JobsDetailRatesParts({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
precision={4}
|
||||||
|
disabled={jobRO}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in1")}
|
||||||
|
name={["parts_tax_rates", "PAG", "prt_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in2")}
|
||||||
|
name={["parts_tax_rates", "PAG", "prt_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in3")}
|
||||||
|
name={["parts_tax_rates", "PAG", "prt_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in4")}
|
||||||
|
name={["parts_tax_rates", "PAG", "prt_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in5")}
|
||||||
|
name={["parts_tax_rates", "PAG", "prt_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.PAM")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.PAM")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "PAM", "prt_discp"]}
|
name={["parts_tax_rates", "PAM", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -242,7 +402,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "PAM", "prt_mkupp"]}
|
name={["parts_tax_rates", "PAM", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -268,18 +428,58 @@ export function JobsDetailRatesParts({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
precision={4}
|
||||||
|
disabled={jobRO}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in1")}
|
||||||
|
name={["parts_tax_rates", "PAM", "prt_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in2")}
|
||||||
|
name={["parts_tax_rates", "PAM", "prt_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in3")}
|
||||||
|
name={["parts_tax_rates", "PAM", "prt_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in4")}
|
||||||
|
name={["parts_tax_rates", "PAM", "prt_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in5")}
|
||||||
|
name={["parts_tax_rates", "PAM", "prt_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.PAN")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.PAN")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "PAN", "prt_discp"]}
|
name={["parts_tax_rates", "PAN", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -292,7 +492,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "PAN", "prt_mkupp"]}
|
name={["parts_tax_rates", "PAN", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -318,18 +518,58 @@ export function JobsDetailRatesParts({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
precision={4}
|
||||||
|
disabled={jobRO}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in1")}
|
||||||
|
name={["parts_tax_rates", "PAN", "prt_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in2")}
|
||||||
|
name={["parts_tax_rates", "PAN", "prt_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in3")}
|
||||||
|
name={["parts_tax_rates", "PAN", "prt_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in4")}
|
||||||
|
name={["parts_tax_rates", "PAN", "prt_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in5")}
|
||||||
|
name={["parts_tax_rates", "PAN", "prt_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.PAO")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.PAO")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "PAO", "prt_discp"]}
|
name={["parts_tax_rates", "PAO", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -342,7 +582,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "PAO", "prt_mkupp"]}
|
name={["parts_tax_rates", "PAO", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -368,18 +608,58 @@ export function JobsDetailRatesParts({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
precision={4}
|
||||||
|
disabled={jobRO}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in1")}
|
||||||
|
name={["parts_tax_rates", "PAO", "prt_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in2")}
|
||||||
|
name={["parts_tax_rates", "PAO", "prt_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in3")}
|
||||||
|
name={["parts_tax_rates", "PAO", "prt_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in4")}
|
||||||
|
name={["parts_tax_rates", "PAO", "prt_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in5")}
|
||||||
|
name={["parts_tax_rates", "PAO", "prt_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.PAP")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.PAP")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "PAP", "prt_discp"]}
|
name={["parts_tax_rates", "PAP", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -392,7 +672,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "PAP", "prt_mkupp"]}
|
name={["parts_tax_rates", "PAP", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -418,18 +698,58 @@ export function JobsDetailRatesParts({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
precision={4}
|
||||||
|
disabled={jobRO}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in1")}
|
||||||
|
name={["parts_tax_rates", "PAP", "prt_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in2")}
|
||||||
|
name={["parts_tax_rates", "PAP", "prt_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in3")}
|
||||||
|
name={["parts_tax_rates", "PAP", "prt_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in4")}
|
||||||
|
name={["parts_tax_rates", "PAP", "prt_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in5")}
|
||||||
|
name={["parts_tax_rates", "PAP", "prt_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.PAR")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.PAR")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "PAR", "prt_discp"]}
|
name={["parts_tax_rates", "PAR", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -442,7 +762,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "PAR", "prt_mkupp"]}
|
name={["parts_tax_rates", "PAR", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -468,18 +788,58 @@ export function JobsDetailRatesParts({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
precision={4}
|
||||||
|
disabled={jobRO}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in1")}
|
||||||
|
name={["parts_tax_rates", "PAR", "prt_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in2")}
|
||||||
|
name={["parts_tax_rates", "PAR", "prt_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in3")}
|
||||||
|
name={["parts_tax_rates", "PAR", "prt_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in4")}
|
||||||
|
name={["parts_tax_rates", "PAR", "prt_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in5")}
|
||||||
|
name={["parts_tax_rates", "PAR", "prt_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.PAS")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.PAS")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "PAS", "prt_discp"]}
|
name={["parts_tax_rates", "PAS", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -492,7 +852,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "PAS", "prt_mkupp"]}
|
name={["parts_tax_rates", "PAS", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -518,18 +878,58 @@ export function JobsDetailRatesParts({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
precision={4}
|
||||||
|
disabled={jobRO}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in1")}
|
||||||
|
name={["parts_tax_rates", "PAS", "prt_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in2")}
|
||||||
|
name={["parts_tax_rates", "PAS", "prt_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in3")}
|
||||||
|
name={["parts_tax_rates", "PAS", "prt_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in4")}
|
||||||
|
name={["parts_tax_rates", "PAS", "prt_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in5")}
|
||||||
|
name={["parts_tax_rates", "PAS", "prt_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.PASL")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.PASL")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "PASL", "prt_discp"]}
|
name={["parts_tax_rates", "PASL", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -542,7 +942,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "PASL", "prt_mkupp"]}
|
name={["parts_tax_rates", "PASL", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -568,18 +968,58 @@ export function JobsDetailRatesParts({
|
|||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber
|
||||||
|
min={0}
|
||||||
|
max={100}
|
||||||
|
precision={4}
|
||||||
|
disabled={jobRO}
|
||||||
|
/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
}}
|
}}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in1")}
|
||||||
|
name={["parts_tax_rates", "PASL", "prt_tx_in1"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in2")}
|
||||||
|
name={["parts_tax_rates", "PASL", "prt_tx_in2"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in3")}
|
||||||
|
name={["parts_tax_rates", "PASL", "prt_tx_in3"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in4")}
|
||||||
|
name={["parts_tax_rates", "PASL", "prt_tx_in4"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("jobs.fields.parts_tax_rates.prt_tx_in5")}
|
||||||
|
name={["parts_tax_rates", "PASL", "prt_tx_in5"]}
|
||||||
|
valuePropName="checked"
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.CCDR")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.CCDR")}>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "CCDR", "prt_discp"]}
|
name={["parts_tax_rates", "CCDR", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -592,7 +1032,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "CCDR", "prt_mkupp"]}
|
name={["parts_tax_rates", "CCDR", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -605,7 +1045,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_rt")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_rt")}
|
||||||
name={["parts_tax_rates", "CCDR", "prt_tax_rt"]}
|
name={["parts_tax_rates", "CCDR", "prt_tax_rt"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.CCF")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.CCF")}>
|
||||||
@@ -613,7 +1053,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "CCF", "prt_discp"]}
|
name={["parts_tax_rates", "CCF", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -626,7 +1066,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "CCF", "prt_mkupp"]}
|
name={["parts_tax_rates", "CCF", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -639,7 +1079,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_rt")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_rt")}
|
||||||
name={["parts_tax_rates", "CCF", "prt_tax_rt"]}
|
name={["parts_tax_rates", "CCF", "prt_tax_rt"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.CCM")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.CCM")}>
|
||||||
@@ -647,7 +1087,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "CCM", "prt_discp"]}
|
name={["parts_tax_rates", "CCM", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -660,7 +1100,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "CCM", "prt_mkupp"]}
|
name={["parts_tax_rates", "CCM", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -673,7 +1113,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_rt")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_rt")}
|
||||||
name={["parts_tax_rates", "CCM", "prt_tax_rt"]}
|
name={["parts_tax_rates", "CCM", "prt_tax_rt"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.CCC")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.CCC")}>
|
||||||
@@ -681,7 +1121,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "CCC", "prt_discp"]}
|
name={["parts_tax_rates", "CCC", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -694,7 +1134,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "CCC", "prt_mkupp"]}
|
name={["parts_tax_rates", "CCC", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -707,7 +1147,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_rt")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_rt")}
|
||||||
name={["parts_tax_rates", "CCC", "prt_tax_rt"]}
|
name={["parts_tax_rates", "CCC", "prt_tax_rt"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("joblines.fields.part_types.CCD")}>
|
<LayoutFormRow header={t("joblines.fields.part_types.CCD")}>
|
||||||
@@ -715,7 +1155,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
label={t("jobs.fields.parts_tax_rates.prt_discp")}
|
||||||
name={["parts_tax_rates", "CCD", "prt_discp"]}
|
name={["parts_tax_rates", "CCD", "prt_discp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mktyp")}
|
||||||
@@ -728,7 +1168,7 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
label={t("jobs.fields.parts_tax_rates.prt_mkupp")}
|
||||||
name={["parts_tax_rates", "CCD", "prt_mkupp"]}
|
name={["parts_tax_rates", "CCD", "prt_mkupp"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_in")}
|
||||||
@@ -741,39 +1181,39 @@ export function JobsDetailRatesParts({
|
|||||||
label={t("jobs.fields.parts_tax_rates.prt_tax_rt")}
|
label={t("jobs.fields.parts_tax_rates.prt_tax_rt")}
|
||||||
name={["parts_tax_rates", "CCD", "prt_tax_rt"]}
|
name={["parts_tax_rates", "CCD", "prt_tax_rt"]}
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow>
|
<LayoutFormRow>
|
||||||
<Form.Item label={t("jobs.fields.tax_tow_rt")} name="tax_tow_rt">
|
<Form.Item label={t("jobs.fields.tax_tow_rt")} name="tax_tow_rt">
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.tax_str_rt")} name="tax_str_rt">
|
<Form.Item label={t("jobs.fields.tax_str_rt")} name="tax_str_rt">
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.tax_paint_mat_rt")}
|
label={t("jobs.fields.tax_paint_mat_rt")}
|
||||||
name="tax_paint_mat_rt"
|
name="tax_paint_mat_rt"
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.tax_shop_mat_rt")}
|
label={t("jobs.fields.tax_shop_mat_rt")}
|
||||||
name="tax_shop_mat_rt"
|
name="tax_shop_mat_rt"
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.tax_sub_rt")} name="tax_sub_rt">
|
<Form.Item label={t("jobs.fields.tax_sub_rt")} name="tax_sub_rt">
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item label={t("jobs.fields.tax_lbr_rt")} name="tax_lbr_rt">
|
<Form.Item label={t("jobs.fields.tax_lbr_rt")} name="tax_lbr_rt">
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
label={t("jobs.fields.tax_levies_rt")}
|
label={t("jobs.fields.tax_levies_rt")}
|
||||||
name="tax_levies_rt"
|
name="tax_levies_rt"
|
||||||
>
|
>
|
||||||
<InputNumber min={0} max={1} precision={2} disabled={jobRO} />
|
<InputNumber min={0} max={100} precision={4} disabled={jobRO} />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
</Collapse.Panel>
|
</Collapse.Panel>
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
import { Button, Popconfirm } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
|
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
|
||||||
|
)(JobsDetailRatesProfileOVerride);
|
||||||
|
|
||||||
|
export function JobsDetailRatesProfileOVerride({ bodyshop, form }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
return (
|
||||||
|
<Popconfirm
|
||||||
|
onConfirm={() => {
|
||||||
|
form.setFieldsValue({
|
||||||
|
cieca_pft: {
|
||||||
|
...bodyshop.md_responsibility_centers.taxes.tax_ty1,
|
||||||
|
...bodyshop.md_responsibility_centers.taxes.tax_ty2,
|
||||||
|
...bodyshop.md_responsibility_centers.taxes.tax_ty3,
|
||||||
|
...bodyshop.md_responsibility_centers.taxes.tax_ty4,
|
||||||
|
...bodyshop.md_responsibility_centers.taxes.tax_ty5,
|
||||||
|
},
|
||||||
|
materials: bodyshop.md_responsibility_centers.cieca_pfm,
|
||||||
|
cieca_pfl: bodyshop.md_responsibility_centers.cieca_pfl,
|
||||||
|
parts_tax_rates: bodyshop.md_responsibility_centers.parts_tax_rates,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
title={t("jobs.actions.taxprofileoverride_confirm")}
|
||||||
|
>
|
||||||
|
<Button type="link">{t("jobs.actions.taxprofileoverride")}</Button>
|
||||||
|
</Popconfirm>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
import { Collapse, Divider, Form, Input, InputNumber, Space } from "antd";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
|
||||||
|
export function JobsDetailRatesTaxes({
|
||||||
|
jobRO,
|
||||||
|
expanded,
|
||||||
|
bodyshop,
|
||||||
|
required = true,
|
||||||
|
form,
|
||||||
|
}) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const formItems = [];
|
||||||
|
for (let tyCounter = 1; tyCounter <= 5; tyCounter++) {
|
||||||
|
const section = [];
|
||||||
|
|
||||||
|
section.push(
|
||||||
|
TaxFormItems({
|
||||||
|
typeNum: tyCounter,
|
||||||
|
rootElements: true,
|
||||||
|
bodyshop,
|
||||||
|
jobRO,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
for (let iterator = 1; iterator <= 5; iterator++) {
|
||||||
|
section.push(
|
||||||
|
TaxFormItems({
|
||||||
|
typeNum: tyCounter,
|
||||||
|
typeNumIterator: iterator,
|
||||||
|
rootElements: false,
|
||||||
|
jobRO,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
formItems.push(Space({ children: section, wrap: true }));
|
||||||
|
formItems.push(<Divider />);
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<Collapse defaultActiveKey={expanded && "rates"}>
|
||||||
|
<Collapse.Panel
|
||||||
|
forceRender
|
||||||
|
header={t("jobs.labels.cieca_pft")}
|
||||||
|
key="cieca_pft"
|
||||||
|
>
|
||||||
|
{formItems}
|
||||||
|
</Collapse.Panel>
|
||||||
|
</Collapse>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default connect(mapStateToProps, null)(JobsDetailRatesTaxes);
|
||||||
|
|
||||||
|
function TaxFormItems({
|
||||||
|
typeNum,
|
||||||
|
typeNumIterator,
|
||||||
|
rootElements,
|
||||||
|
bodyshopjobRO,
|
||||||
|
jobRO,
|
||||||
|
}) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
if (rootElements)
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.responsibilitycenter_tax_type", {
|
||||||
|
typeNum,
|
||||||
|
typeNumIterator,
|
||||||
|
})}
|
||||||
|
// rules={[
|
||||||
|
// {
|
||||||
|
// required: true,
|
||||||
|
// //message: t("general.validation.required"),
|
||||||
|
// },
|
||||||
|
// ]}
|
||||||
|
name={["cieca_pft", `tax_type${typeNum}`]}
|
||||||
|
>
|
||||||
|
<Input disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.responsibilitycenter_tax_tier", {
|
||||||
|
typeNum,
|
||||||
|
typeNumIterator,
|
||||||
|
})}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
name={["cieca_pft", `ty${typeNum}_tier${typeNumIterator}`]}
|
||||||
|
>
|
||||||
|
<InputNumber precision={0} min={0} disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.responsibilitycenter_tax_thres", {
|
||||||
|
typeNum,
|
||||||
|
typeNumIterator,
|
||||||
|
})}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
name={["cieca_pft", `ty${typeNum}_thres${typeNumIterator}`]}
|
||||||
|
>
|
||||||
|
<InputNumber min={0} precision={2} disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.responsibilitycenter_tax_rate", {
|
||||||
|
typeNum,
|
||||||
|
typeNumIterator,
|
||||||
|
})}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
name={["cieca_pft", `ty${typeNum}_rate${typeNumIterator}`]}
|
||||||
|
>
|
||||||
|
<InputNumber min={0} precision={2} disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.responsibilitycenter_tax_sur", {
|
||||||
|
typeNum,
|
||||||
|
typeNumIterator,
|
||||||
|
})}
|
||||||
|
rules={[
|
||||||
|
{
|
||||||
|
required: true,
|
||||||
|
//message: t("general.validation.required"),
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
name={["cieca_pft", `ty${typeNum}_sur${typeNumIterator}`]}
|
||||||
|
>
|
||||||
|
<InputNumber min={0} precision={2} disabled={jobRO} />
|
||||||
|
</Form.Item>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -9,10 +9,12 @@ import { createStructuredSelector } from "reselect";
|
|||||||
import { auth, logImEXEvent } from "../../firebase/firebase.utils";
|
import { auth, logImEXEvent } from "../../firebase/firebase.utils";
|
||||||
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
import { INSERT_EXPORT_LOG } from "../../graphql/accounting.queries";
|
||||||
import { UPDATE_JOBS } from "../../graphql/jobs.queries";
|
import { UPDATE_JOBS } from "../../graphql/jobs.queries";
|
||||||
|
import { insertAuditTrail } from "../../redux/application/application.actions";
|
||||||
import {
|
import {
|
||||||
selectBodyshop,
|
selectBodyshop,
|
||||||
selectCurrentUser,
|
selectCurrentUser,
|
||||||
} from "../../redux/user/user.selectors";
|
} from "../../redux/user/user.selectors";
|
||||||
|
import AuditTrailMapping from "../../utils/AuditTrailMappings";
|
||||||
import client from "../../utils/GraphQLClient";
|
import client from "../../utils/GraphQLClient";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
@@ -20,6 +22,11 @@ const mapStateToProps = createStructuredSelector({
|
|||||||
currentUser: selectCurrentUser,
|
currentUser: selectCurrentUser,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => ({
|
||||||
|
insertAuditTrail: ({ jobid, operation }) =>
|
||||||
|
dispatch(insertAuditTrail({ jobid, operation })),
|
||||||
|
});
|
||||||
|
|
||||||
function updateJobCache(items) {
|
function updateJobCache(items) {
|
||||||
client.cache.modify({
|
client.cache.modify({
|
||||||
id: "ROOT_QUERY",
|
id: "ROOT_QUERY",
|
||||||
@@ -41,6 +48,7 @@ export function JobsExportAllButton({
|
|||||||
loadingCallback,
|
loadingCallback,
|
||||||
completedCallback,
|
completedCallback,
|
||||||
refetch,
|
refetch,
|
||||||
|
insertAuditTrail,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [updateJob] = useMutation(UPDATE_JOBS);
|
const [updateJob] = useMutation(UPDATE_JOBS);
|
||||||
@@ -177,6 +185,12 @@ export function JobsExportAllButton({
|
|||||||
key: "jobsuccessexport",
|
key: "jobsuccessexport",
|
||||||
message: t("jobs.successes.exported"),
|
message: t("jobs.successes.exported"),
|
||||||
});
|
});
|
||||||
|
jobUpdateResponse.data.update_jobs.returning.forEach((job) => {
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: job.id,
|
||||||
|
operation: AuditTrailMapping.jobexported(),
|
||||||
|
});
|
||||||
|
});
|
||||||
updateJobCache(
|
updateJobCache(
|
||||||
jobUpdateResponse.data.update_jobs.returning.map(
|
jobUpdateResponse.data.update_jobs.returning.map(
|
||||||
(job) => job.id
|
(job) => job.id
|
||||||
@@ -190,13 +204,17 @@ export function JobsExportAllButton({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (bodyshop.accountingconfig && bodyshop.accountingconfig.qbo && successfulTransactions.length > 0) {
|
if (
|
||||||
|
bodyshop.accountingconfig &&
|
||||||
|
bodyshop.accountingconfig.qbo &&
|
||||||
|
successfulTransactions.length > 0
|
||||||
|
) {
|
||||||
notification.open({
|
notification.open({
|
||||||
type: "success",
|
type: "success",
|
||||||
key: "jobsuccessexport",
|
key: "jobsuccessexport",
|
||||||
message: t("jobs.successes.exported"),
|
message: t("jobs.successes.exported"),
|
||||||
});
|
});
|
||||||
updateJobCache([
|
const successfulTransactionsSet = [
|
||||||
...new Set(
|
...new Set(
|
||||||
successfulTransactions.map(
|
successfulTransactions.map(
|
||||||
(st) =>
|
(st) =>
|
||||||
@@ -207,7 +225,14 @@ export function JobsExportAllButton({
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
]);
|
];
|
||||||
|
if (successfulTransactionsSet.length > 0) {
|
||||||
|
insertAuditTrail({
|
||||||
|
jobid: successfulTransactionsSet[0],
|
||||||
|
operation: AuditTrailMapping.jobexported(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
updateJobCache(successfulTransactionsSet);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -225,4 +250,7 @@ export function JobsExportAllButton({
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(mapStateToProps, null)(JobsExportAllButton);
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(JobsExportAllButton);
|
||||||
|
|||||||
@@ -1,9 +1,11 @@
|
|||||||
import { SyncOutlined } from "@ant-design/icons";
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
import { Checkbox, Divider, Input, Table, Button } from "antd";
|
import { Button, Checkbox, Divider, Input, Space, Table } from "antd";
|
||||||
import React from "react";
|
import moment from "moment";
|
||||||
|
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 PhoneFormatter from "../../utils/PhoneFormatter";
|
import PhoneFormatter from "../../utils/PhoneFormatter";
|
||||||
|
import FormDateTimePickerComponent from "../form-date-time-picker/form-date-time-picker.component";
|
||||||
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
export default function JobsFindModalComponent({
|
export default function JobsFindModalComponent({
|
||||||
@@ -16,11 +18,13 @@ export default function JobsFindModalComponent({
|
|||||||
jobsListRefetch,
|
jobsListRefetch,
|
||||||
partsQueueToggle,
|
partsQueueToggle,
|
||||||
setPartsQueueToggle,
|
setPartsQueueToggle,
|
||||||
|
updateSchComp,
|
||||||
|
setSchComp,
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const [modalSearch, setModalSearch] = modalSearchState;
|
const [modalSearch, setModalSearch] = modalSearchState;
|
||||||
const [importOptions, setImportOptions] = importOptionsState;
|
const [importOptions, setImportOptions] = importOptionsState;
|
||||||
|
const [checkUTT, setCheckUTT] = useState(false);
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.ro_number"),
|
title: t("jobs.fields.ro_number"),
|
||||||
@@ -142,6 +146,35 @@ export default function JobsFindModalComponent({
|
|||||||
if (record) {
|
if (record) {
|
||||||
if (record.id) {
|
if (record.id) {
|
||||||
setSelectedJob(record.id);
|
setSelectedJob(record.id);
|
||||||
|
if (record.actual_in && record.scheduled_completion) {
|
||||||
|
setSchComp({
|
||||||
|
...updateSchComp,
|
||||||
|
actual_in: record.actual_in,
|
||||||
|
scheduled_completion: record.scheduled_completion,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (record.actual_in && !record.scheduled_completion) {
|
||||||
|
setSchComp({
|
||||||
|
...updateSchComp,
|
||||||
|
actual_in: record.actual_in,
|
||||||
|
scheduled_completion: moment(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!record.actual_in && record.scheduled_completion) {
|
||||||
|
setSchComp({
|
||||||
|
...updateSchComp,
|
||||||
|
actual_in: moment(),
|
||||||
|
scheduled_completion: moment(record.scheduled_completion),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!record.actual_in && !record.scheduled_completion) {
|
||||||
|
setSchComp({
|
||||||
|
...updateSchComp,
|
||||||
|
actual_in: moment(),
|
||||||
|
scheduled_completion: moment(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -177,6 +210,35 @@ export default function JobsFindModalComponent({
|
|||||||
rowSelection={{
|
rowSelection={{
|
||||||
onSelect: (props) => {
|
onSelect: (props) => {
|
||||||
setSelectedJob(props.id);
|
setSelectedJob(props.id);
|
||||||
|
if (props.actual_in && props.scheduled_completion) {
|
||||||
|
setSchComp({
|
||||||
|
...updateSchComp,
|
||||||
|
actual_in: props.actual_in,
|
||||||
|
scheduled_completion: props.scheduled_completion,
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
if (props.actual_in && !props.scheduled_completion) {
|
||||||
|
setSchComp({
|
||||||
|
...updateSchComp,
|
||||||
|
actual_in: props.actual_in,
|
||||||
|
scheduled_completion: moment(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!props.actual_in && props.scheduled_completion) {
|
||||||
|
setSchComp({
|
||||||
|
...updateSchComp,
|
||||||
|
actual_in: moment(),
|
||||||
|
scheduled_completion: moment(props.scheduled_completion),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (!props.actual_in && !props.scheduled_completion) {
|
||||||
|
setSchComp({
|
||||||
|
...updateSchComp,
|
||||||
|
actual_in: moment(),
|
||||||
|
scheduled_completion: moment(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
type: "radio",
|
type: "radio",
|
||||||
selectedRowKeys: [selectedJob],
|
selectedRowKeys: [selectedJob],
|
||||||
@@ -190,23 +252,58 @@ export default function JobsFindModalComponent({
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<Divider />
|
<Divider />
|
||||||
<Checkbox
|
<Space>
|
||||||
defaultChecked={importOptions.overrideHeader}
|
<Checkbox
|
||||||
onChange={(e) =>
|
defaultChecked={importOptions.overrideHeader}
|
||||||
setImportOptions({
|
onChange={(e) =>
|
||||||
...importOptions,
|
setImportOptions({
|
||||||
overrideHeaders: e.target.checked,
|
...importOptions,
|
||||||
})
|
overrideHeaders: e.target.checked,
|
||||||
}
|
})
|
||||||
>
|
}
|
||||||
{t("jobs.labels.override_header")}
|
>
|
||||||
</Checkbox>
|
{t("jobs.labels.override_header")}
|
||||||
<Checkbox
|
</Checkbox>
|
||||||
|
<Checkbox
|
||||||
checked={partsQueueToggle}
|
checked={partsQueueToggle}
|
||||||
onChange={(e) => setPartsQueueToggle(e.target.checked)}
|
onChange={(e) => setPartsQueueToggle(e.target.checked)}
|
||||||
>
|
>
|
||||||
{t("bodyshop.fields.md_functionality_toggles.parts_queue_toggle")}
|
{t("bodyshop.fields.md_functionality_toggles.parts_queue_toggle")}
|
||||||
</Checkbox>
|
</Checkbox>
|
||||||
|
<Checkbox
|
||||||
|
checked={updateSchComp.checked}
|
||||||
|
onChange={(e) =>
|
||||||
|
setSchComp({ ...updateSchComp, checked: e.target.checked })
|
||||||
|
}
|
||||||
|
>
|
||||||
|
{t("jobs.labels.update_scheduled_completion")}
|
||||||
|
</Checkbox>
|
||||||
|
{updateSchComp.checked === true ? (
|
||||||
|
<>
|
||||||
|
{checkUTT === false ? (
|
||||||
|
<FormDateTimePickerComponent
|
||||||
|
value={updateSchComp.scheduled_completion}
|
||||||
|
onChange={(e) => {
|
||||||
|
setSchComp({ ...updateSchComp, scheduled_completion: e });
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
) : null}
|
||||||
|
<Checkbox
|
||||||
|
checked={checkUTT}
|
||||||
|
onChange={(e) => {
|
||||||
|
setCheckUTT(e.target.checked);
|
||||||
|
setSchComp({
|
||||||
|
...updateSchComp,
|
||||||
|
scheduled_completion: null,
|
||||||
|
automatic: true,
|
||||||
|
});
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("jobs.labels.calc_scheuled_completion")}
|
||||||
|
</Checkbox>
|
||||||
|
</>
|
||||||
|
) : null}
|
||||||
|
</Space>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,8 @@ export default connect(
|
|||||||
modalSearchState,
|
modalSearchState,
|
||||||
partsQueueToggle,
|
partsQueueToggle,
|
||||||
setPartsQueueToggle,
|
setPartsQueueToggle,
|
||||||
|
updateSchComp,
|
||||||
|
setSchComp,
|
||||||
...modalProps
|
...modalProps
|
||||||
}) {
|
}) {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@@ -95,6 +97,8 @@ export default connect(
|
|||||||
modalSearchState={modalSearchState}
|
modalSearchState={modalSearchState}
|
||||||
partsQueueToggle={partsQueueToggle}
|
partsQueueToggle={partsQueueToggle}
|
||||||
setPartsQueueToggle={setPartsQueueToggle}
|
setPartsQueueToggle={setPartsQueueToggle}
|
||||||
|
updateSchComp={updateSchComp}
|
||||||
|
setSchComp={setSchComp}
|
||||||
/>
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -10,9 +10,10 @@ import { Link, useHistory, useLocation } from "react-router-dom";
|
|||||||
import { createStructuredSelector } from "reselect";
|
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 { pageLimit } from "../../utils/config";
|
||||||
|
import useLocalStorage from "../../utils/useLocalStorage";
|
||||||
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";
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
import {pageLimit} from "../../utils/config";
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
//currentUser: selectCurrentUser
|
//currentUser: selectCurrentUser
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -25,6 +26,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
const search = queryString.parse(useLocation().search);
|
const search = queryString.parse(useLocation().search);
|
||||||
const [openSearchResults, setOpenSearchResults] = useState([]);
|
const [openSearchResults, setOpenSearchResults] = useState([]);
|
||||||
const [searchLoading, setSearchLoading] = useState(false);
|
const [searchLoading, setSearchLoading] = useState(false);
|
||||||
|
const [filter, setFilter] = useLocalStorage("filter_jobs_all", null);
|
||||||
const { page, sortcolumn, sortorder } = search;
|
const { page, sortcolumn, sortorder } = search;
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
|
|
||||||
@@ -93,6 +95,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.status || t("general.labels.na");
|
return record.status || t("general.labels.na");
|
||||||
},
|
},
|
||||||
|
filteredValue: filter?.status || null,
|
||||||
filters: bodyshop.md_ro_statuses.statuses.map((s) => {
|
filters: bodyshop.md_ro_statuses.statuses.map((s) => {
|
||||||
return { text: s, value: [s] };
|
return { text: s, value: [s] };
|
||||||
}),
|
}),
|
||||||
@@ -189,6 +192,7 @@ export function JobsList({ bodyshop, refetch, loading, jobs, total }) {
|
|||||||
} else {
|
} else {
|
||||||
delete search.statusFilters;
|
delete search.statusFilters;
|
||||||
}
|
}
|
||||||
|
setFilter(filters);
|
||||||
history.push({ search: queryString.stringify(search) });
|
history.push({ search: queryString.stringify(search) });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import {
|
import {
|
||||||
SyncOutlined,
|
BranchesOutlined,
|
||||||
ExclamationCircleFilled,
|
ExclamationCircleFilled,
|
||||||
PauseCircleOutlined,
|
PauseCircleOutlined,
|
||||||
BranchesOutlined,
|
SyncOutlined,
|
||||||
} from "@ant-design/icons";
|
} from "@ant-design/icons";
|
||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import { Button, Card, Grid, Input, Space, Table, Tooltip } from "antd";
|
import { Button, Card, Grid, Input, Space, Table, Tooltip } from "antd";
|
||||||
@@ -14,382 +14,389 @@ import { Link, useHistory, useLocation } from "react-router-dom";
|
|||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import { onlyUnique } from "../../utils/arrayHelper";
|
|
||||||
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { onlyUnique } from "../../utils/arrayHelper";
|
||||||
|
import { alphaSort, statusSort } from "../../utils/sorters";
|
||||||
|
import useLocalStorage from "../../utils/useLocalStorage";
|
||||||
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";
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
|
|
||||||
export function JobsList({ bodyshop }) {
|
export function JobsList({ bodyshop }) {
|
||||||
const searchParams = queryString.parse(useLocation().search);
|
const searchParams = queryString.parse(useLocation().search);
|
||||||
const { selected } = searchParams;
|
const { selected } = searchParams;
|
||||||
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
||||||
.filter((screen) => !!screen[1])
|
.filter((screen) => !!screen[1])
|
||||||
.slice(-1)[0];
|
.slice(-1)[0];
|
||||||
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
const { loading, error, data, refetch } = useQuery(QUERY_ALL_ACTIVE_JOBS, {
|
||||||
variables: {
|
variables: {
|
||||||
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
|
statuses: bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
|
||||||
},
|
},
|
||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
});
|
});
|
||||||
|
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({ sortedInfo: {} });
|
||||||
sortedInfo: {},
|
const [filter, setFilter] = useLocalStorage("filter_jobs_list", null);
|
||||||
filteredInfo: { text: "" },
|
|
||||||
});
|
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const [searchText, setSearchText] = useState("");
|
const [searchText, setSearchText] = useState("");
|
||||||
|
|
||||||
if (error) return <AlertComponent message={error.message} type="error" />;
|
if (error) return <AlertComponent message={error.message} type="error" />;
|
||||||
|
|
||||||
const jobs = data
|
const jobs = data
|
||||||
? searchText === ""
|
? searchText === ""
|
||||||
? data.jobs
|
? data.jobs
|
||||||
: data.jobs.filter(
|
: data.jobs.filter(
|
||||||
(j) =>
|
(j) =>
|
||||||
(j.ro_number || "")
|
(j.ro_number || "")
|
||||||
.toString()
|
.toString()
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase()) ||
|
.includes(searchText.toLowerCase()) ||
|
||||||
(j.ownr_co_nm || "")
|
(j.ownr_co_nm || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase()) ||
|
.includes(searchText.toLowerCase()) ||
|
||||||
(j.comments || "")
|
(j.comments || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase()) ||
|
.includes(searchText.toLowerCase()) ||
|
||||||
(j.ownr_fn || "")
|
(j.ownr_fn || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase()) ||
|
.includes(searchText.toLowerCase()) ||
|
||||||
(j.ownr_ln || "")
|
(j.ownr_ln || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase()) ||
|
.includes(searchText.toLowerCase()) ||
|
||||||
(j.clm_no || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
(j.clm_no || "").toLowerCase().includes(searchText.toLowerCase()) ||
|
||||||
(j.plate_no || "")
|
(j.plate_no || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase()) ||
|
.includes(searchText.toLowerCase()) ||
|
||||||
(j.v_model_desc || "")
|
(j.v_model_desc || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase()) ||
|
.includes(searchText.toLowerCase()) ||
|
||||||
(j.est_ct_fn || "")
|
(j.est_ct_fn || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase()) ||
|
.includes(searchText.toLowerCase()) ||
|
||||||
(j.est_ct_ln || "")
|
(j.est_ct_ln || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase()) ||
|
.includes(searchText.toLowerCase()) ||
|
||||||
(j.v_make_desc || "")
|
(j.v_make_desc || "")
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.includes(searchText.toLowerCase())
|
.includes(searchText.toLowerCase())
|
||||||
)
|
)
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const handleTableChange = (pagination, filters, sorter) => {
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
setState({ ...state, sortedInfo: sorter });
|
||||||
};
|
setFilter(filters);
|
||||||
|
};
|
||||||
|
|
||||||
const handleOnRowClick = (record) => {
|
const handleOnRowClick = (record) => {
|
||||||
if (record) {
|
if (record) {
|
||||||
if (record.id) {
|
if (record.id) {
|
||||||
history.push({
|
history.push({
|
||||||
search: queryString.stringify({
|
search: queryString.stringify({
|
||||||
...searchParams,
|
...searchParams,
|
||||||
selected: record.id,
|
selected: record.id,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.ro_number"),
|
title: t("jobs.fields.ro_number"),
|
||||||
dataIndex: "ro_number",
|
dataIndex: "ro_number",
|
||||||
key: "ro_number",
|
key: "ro_number",
|
||||||
sorter: (a, b) =>
|
sorter: (a, b) =>
|
||||||
parseInt((a.ro_number || "0").replace(/\D/g, "")) -
|
parseInt((a.ro_number || "0").replace(/\D/g, "")) -
|
||||||
parseInt((b.ro_number || "0").replace(/\D/g, "")),
|
parseInt((b.ro_number || "0").replace(/\D/g, "")),
|
||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
render: (text, record) => (
|
<Link
|
||||||
<Link
|
to={"/manage/jobs/" + record.id}
|
||||||
to={"/manage/jobs/" + record.id}
|
onClick={(e) => e.stopPropagation()}
|
||||||
onClick={(e) => e.stopPropagation()}
|
>
|
||||||
>
|
<Space>
|
||||||
<Space>
|
{record.ro_number || t("general.labels.na")}
|
||||||
{record.ro_number || t("general.labels.na")}
|
{record.production_vars && record.production_vars.alert ? (
|
||||||
{record.production_vars && record.production_vars.alert ? (
|
<ExclamationCircleFilled className="production-alert" />
|
||||||
<ExclamationCircleFilled className="production-alert" />
|
) : null}
|
||||||
) : null}
|
{record.suspended && (
|
||||||
{record.suspended && (
|
<PauseCircleOutlined style={{ color: "orangered" }} />
|
||||||
<PauseCircleOutlined style={{ color: "orangered" }} />
|
)}
|
||||||
)}
|
{record.iouparent && (
|
||||||
{record.iouparent && (
|
<Tooltip title={t("jobs.labels.iou")}>
|
||||||
<Tooltip title={t("jobs.labels.iou")}>
|
<BranchesOutlined style={{ color: "orangered" }} />
|
||||||
<BranchesOutlined style={{ color: "orangered" }} />
|
</Tooltip>
|
||||||
</Tooltip>
|
)}
|
||||||
)}
|
</Space>
|
||||||
</Space>
|
</Link>
|
||||||
</Link>
|
),
|
||||||
),
|
},
|
||||||
},
|
{
|
||||||
{
|
title: t("jobs.fields.owner"),
|
||||||
title: t("jobs.fields.owner"),
|
dataIndex: "owner",
|
||||||
dataIndex: "owner",
|
key: "owner",
|
||||||
key: "owner",
|
ellipsis: true,
|
||||||
ellipsis: true,
|
responsive: ["md"],
|
||||||
|
sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
||||||
responsive: ["md"],
|
sortOrder:
|
||||||
sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
state.sortedInfo.columnKey === "owner" && state.sortedInfo.order,
|
||||||
sortOrder:
|
render: (text, record) => {
|
||||||
state.sortedInfo.columnKey === "owner" && state.sortedInfo.order,
|
return record.ownerid ? (
|
||||||
render: (text, record) => {
|
<Link
|
||||||
return record.ownerid ? (
|
to={"/manage/owners/" + record.ownerid}
|
||||||
<Link
|
onClick={(e) => e.stopPropagation()}
|
||||||
to={"/manage/owners/" + record.ownerid}
|
>
|
||||||
onClick={(e) => e.stopPropagation()}
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
>
|
</Link>
|
||||||
<OwnerNameDisplay ownerObject={record} />
|
) : (
|
||||||
</Link>
|
<span>
|
||||||
) : (
|
|
||||||
<span>
|
|
||||||
<OwnerNameDisplay ownerObject={record} />
|
<OwnerNameDisplay ownerObject={record} />
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.ownr_ph1"),
|
||||||
|
dataIndex: "ownr_ph1",
|
||||||
|
key: "ownr_ph1",
|
||||||
|
ellipsis: true,
|
||||||
|
responsive: ["md"],
|
||||||
|
render: (text, record) => (
|
||||||
|
<ChatOpenButton phone={record.ownr_ph1} jobid={record.id} />
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.ownr_ph2"),
|
||||||
|
dataIndex: "ownr_ph2",
|
||||||
|
key: "ownr_ph2",
|
||||||
|
ellipsis: true,
|
||||||
|
responsive: ["md"],
|
||||||
|
render: (text, record) => (
|
||||||
|
<ChatOpenButton phone={record.ownr_ph2} jobid={record.id} />
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.status"),
|
||||||
|
dataIndex: "status",
|
||||||
|
key: "status",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => alphaSort(a.status, b.status),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||||
|
filteredValue: filter?.status || null,
|
||||||
|
filters:
|
||||||
|
(jobs &&
|
||||||
|
jobs
|
||||||
|
.map((j) => j.status)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Status*",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) =>
|
||||||
|
statusSort(
|
||||||
|
a.text,
|
||||||
|
b.text,
|
||||||
|
bodyshop.md_ro_statuses.active_statuses
|
||||||
|
)
|
||||||
|
)) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.status),
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.vehicle"),
|
||||||
|
dataIndex: "vehicle",
|
||||||
|
key: "vehicle",
|
||||||
|
ellipsis: true,
|
||||||
|
render: (text, record) => {
|
||||||
|
return record.vehicleid ? (
|
||||||
|
<Link
|
||||||
|
to={"/manage/vehicles/" + record.vehicleid}
|
||||||
|
onClick={(e) => e.stopPropagation()}
|
||||||
|
>
|
||||||
|
{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
||||||
|
record.v_model_desc || ""
|
||||||
|
}`}
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span>{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
||||||
|
record.v_model_desc || ""
|
||||||
|
}`}</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("vehicles.fields.plate_no"),
|
||||||
|
dataIndex: "plate_no",
|
||||||
|
key: "plate_no",
|
||||||
|
ellipsis: true,
|
||||||
|
|
||||||
|
responsive: ["md"],
|
||||||
|
sorter: (a, b) => alphaSort(a.plate_no, b.plate_no),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "plate_no" && state.sortedInfo.order,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.clm_no"),
|
||||||
|
dataIndex: "clm_no",
|
||||||
|
key: "clm_no",
|
||||||
|
ellipsis: true,
|
||||||
|
responsive: ["md"],
|
||||||
|
sorter: (a, b) => alphaSort(a.clm_no, b.clm_no),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "clm_no" && state.sortedInfo.order,
|
||||||
|
render: (text, record) =>
|
||||||
|
`${record.clm_no || ""}${
|
||||||
|
record.po_number ? ` (PO: ${record.po_number})` : ""
|
||||||
|
}`,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.ins_co_nm"),
|
||||||
|
dataIndex: "ins_co_nm",
|
||||||
|
key: "ins_co_nm",
|
||||||
|
ellipsis: true,
|
||||||
|
filteredValue: filter?.ins_co_nm || null,
|
||||||
|
filters:
|
||||||
|
(jobs &&
|
||||||
|
jobs
|
||||||
|
.map((j) => j.ins_co_nm)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Ins. Co.*",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.ins_co_nm),
|
||||||
|
responsive: ["md"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.clm_total"),
|
||||||
|
dataIndex: "clm_total",
|
||||||
|
key: "clm_total",
|
||||||
|
responsive: ["md"],
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => a.clm_total - b.clm_total,
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "clm_total" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => (
|
||||||
|
<CurrencyFormatter>{record.clm_total}</CurrencyFormatter>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.labels.estimator"),
|
||||||
|
dataIndex: "jobs.labels.estimator",
|
||||||
|
key: "estimator",
|
||||||
|
ellipsis: true,
|
||||||
|
responsive: ["xl"],
|
||||||
|
filterSearch: true,
|
||||||
|
filteredValue: filter?.estimator || null,
|
||||||
|
filters:
|
||||||
|
(jobs &&
|
||||||
|
jobs
|
||||||
|
.map((j) => `${j.est_ct_fn || ""} ${j.est_ct_ln || ""}`.trim())
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Estimator*",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) =>
|
||||||
|
value.includes(
|
||||||
|
`${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim()
|
||||||
|
),
|
||||||
|
render: (text, record) =>
|
||||||
|
`${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.comment"),
|
||||||
|
dataIndex: "comment",
|
||||||
|
key: "comment",
|
||||||
|
ellipsis: true,
|
||||||
|
responsive: ["md"],
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: t("jobs.fields.owner_owing"),
|
||||||
|
// dataIndex: "owner_owing",
|
||||||
|
// key: "owner_owing",
|
||||||
|
// responsive: ["md"],
|
||||||
|
// render: (text, record) => (
|
||||||
|
// <CurrencyFormatter>{record.owner_owing}</CurrencyFormatter>
|
||||||
|
// ),
|
||||||
|
// },
|
||||||
|
];
|
||||||
|
|
||||||
|
const scrollMapper = {
|
||||||
|
xs: true,
|
||||||
|
sm: true,
|
||||||
|
md: true,
|
||||||
|
lg: "100%",
|
||||||
|
xl: "100%",
|
||||||
|
xxl: "100%",
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
title={t("titles.bc.jobs-active")}
|
||||||
|
extra={
|
||||||
|
<Space wrap>
|
||||||
|
<Button onClick={() => refetch()}>
|
||||||
|
<SyncOutlined />
|
||||||
|
</Button>
|
||||||
|
<Input.Search
|
||||||
|
placeholder={t("general.labels.search")}
|
||||||
|
onChange={(e) => {
|
||||||
|
setSearchText(e.target.value);
|
||||||
|
}}
|
||||||
|
value={searchText}
|
||||||
|
enterButton
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Table
|
||||||
|
loading={loading}
|
||||||
|
pagination={{ defaultPageSize: 50 }}
|
||||||
|
columns={columns}
|
||||||
|
rowKey="id"
|
||||||
|
dataSource={jobs}
|
||||||
|
scroll={{
|
||||||
|
x: selectedBreakpoint ? scrollMapper[selectedBreakpoint[0]] : "100%",
|
||||||
|
}}
|
||||||
|
rowSelection={{
|
||||||
|
onSelect: (record) => {
|
||||||
|
handleOnRowClick(record);
|
||||||
|
},
|
||||||
|
selectedRowKeys: [selected],
|
||||||
|
type: "radio",
|
||||||
|
}}
|
||||||
|
onChange={handleTableChange}
|
||||||
|
onRow={(record, rowIndex) => {
|
||||||
|
return {
|
||||||
|
onClick: (event) => {
|
||||||
|
handleOnRowClick(record);
|
||||||
},
|
},
|
||||||
},
|
};
|
||||||
{
|
}}
|
||||||
title: t("jobs.fields.ownr_ph1"),
|
/>
|
||||||
dataIndex: "ownr_ph1",
|
</Card>
|
||||||
key: "ownr_ph1",
|
);
|
||||||
ellipsis: true,
|
|
||||||
responsive: ["md"],
|
|
||||||
render: (text, record) => (
|
|
||||||
<ChatOpenButton phone={record.ownr_ph1} jobid={record.id} />
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t("jobs.fields.ownr_ph2"),
|
|
||||||
dataIndex: "ownr_ph2",
|
|
||||||
key: "ownr_ph2",
|
|
||||||
ellipsis: true,
|
|
||||||
responsive: ["md"],
|
|
||||||
render: (text, record) => (
|
|
||||||
<ChatOpenButton phone={record.ownr_ph2} jobid={record.id} />
|
|
||||||
),
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: t("jobs.fields.status"),
|
|
||||||
dataIndex: "status",
|
|
||||||
key: "status",
|
|
||||||
ellipsis: true,
|
|
||||||
|
|
||||||
sorter: (a, b) => alphaSort(a.status, b.status),
|
|
||||||
sortOrder:
|
|
||||||
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
|
||||||
filters:
|
|
||||||
(jobs &&
|
|
||||||
jobs
|
|
||||||
.map((j) => j.status)
|
|
||||||
.filter(onlyUnique)
|
|
||||||
.map((s) => {
|
|
||||||
return {
|
|
||||||
text: s || "No Status*",
|
|
||||||
value: [s],
|
|
||||||
};
|
|
||||||
})) ||
|
|
||||||
[],
|
|
||||||
onFilter: (value, record) => value.includes(record.status),
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
title: t("jobs.fields.vehicle"),
|
|
||||||
dataIndex: "vehicle",
|
|
||||||
key: "vehicle",
|
|
||||||
ellipsis: true,
|
|
||||||
render: (text, record) => {
|
|
||||||
return record.vehicleid ? (
|
|
||||||
<Link
|
|
||||||
to={"/manage/vehicles/" + record.vehicleid}
|
|
||||||
onClick={(e) => e.stopPropagation()}
|
|
||||||
>
|
|
||||||
{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
|
||||||
record.v_model_desc || ""
|
|
||||||
}`}
|
|
||||||
</Link>
|
|
||||||
) : (
|
|
||||||
<span>{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
|
||||||
record.v_model_desc || ""
|
|
||||||
}`}</span>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t("vehicles.fields.plate_no"),
|
|
||||||
dataIndex: "plate_no",
|
|
||||||
key: "plate_no",
|
|
||||||
ellipsis: true,
|
|
||||||
|
|
||||||
responsive: ["md"],
|
|
||||||
sorter: (a, b) => alphaSort(a.plate_no, b.plate_no),
|
|
||||||
sortOrder:
|
|
||||||
state.sortedInfo.columnKey === "plate_no" && state.sortedInfo.order,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t("jobs.fields.clm_no"),
|
|
||||||
dataIndex: "clm_no",
|
|
||||||
key: "clm_no",
|
|
||||||
ellipsis: true,
|
|
||||||
responsive: ["md"],
|
|
||||||
sorter: (a, b) => alphaSort(a.clm_no, b.clm_no),
|
|
||||||
sortOrder:
|
|
||||||
state.sortedInfo.columnKey === "clm_no" && state.sortedInfo.order,
|
|
||||||
render: (text, record) =>
|
|
||||||
`${record.clm_no || ""}${
|
|
||||||
record.po_number ? ` (PO: ${record.po_number})` : ""
|
|
||||||
}`,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t("jobs.fields.ins_co_nm"),
|
|
||||||
dataIndex: "ins_co_nm",
|
|
||||||
key: "ins_co_nm",
|
|
||||||
ellipsis: true,
|
|
||||||
filters:
|
|
||||||
(jobs &&
|
|
||||||
jobs
|
|
||||||
.map((j) => j.ins_co_nm)
|
|
||||||
.filter(onlyUnique)
|
|
||||||
.map((s) => {
|
|
||||||
return {
|
|
||||||
text: s,
|
|
||||||
value: [s],
|
|
||||||
};
|
|
||||||
})) ||
|
|
||||||
[],
|
|
||||||
onFilter: (value, record) => value.includes(record.ins_co_nm),
|
|
||||||
responsive: ["md"],
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t("jobs.fields.clm_total"),
|
|
||||||
dataIndex: "clm_total",
|
|
||||||
key: "clm_total",
|
|
||||||
responsive: ["md"],
|
|
||||||
ellipsis: true,
|
|
||||||
|
|
||||||
sorter: (a, b) => a.clm_total - b.clm_total,
|
|
||||||
sortOrder:
|
|
||||||
state.sortedInfo.columnKey === "clm_total" && state.sortedInfo.order,
|
|
||||||
render: (text, record) => (
|
|
||||||
<CurrencyFormatter>{record.clm_total}</CurrencyFormatter>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t("jobs.labels.estimator"),
|
|
||||||
dataIndex: "jobs.labels.estimator",
|
|
||||||
key: "jobs.labels.estimator",
|
|
||||||
ellipsis: true,
|
|
||||||
responsive: ["xl"],
|
|
||||||
filterSearch: true,
|
|
||||||
filters:
|
|
||||||
(jobs &&
|
|
||||||
jobs
|
|
||||||
.map((j) => `${j.est_ct_fn || ""} ${j.est_ct_ln || ""}`.trim())
|
|
||||||
.filter(onlyUnique)
|
|
||||||
.map((s) => {
|
|
||||||
return {
|
|
||||||
text: s || "N/A",
|
|
||||||
value: [s],
|
|
||||||
};
|
|
||||||
})) ||
|
|
||||||
[],
|
|
||||||
onFilter: (value, record) =>
|
|
||||||
value.includes(
|
|
||||||
`${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim()
|
|
||||||
),
|
|
||||||
render: (text, record) =>
|
|
||||||
`${record.est_ct_fn || ""} ${record.est_ct_ln || ""}`.trim(),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: t("jobs.fields.comment"),
|
|
||||||
dataIndex: "comment",
|
|
||||||
key: "comment",
|
|
||||||
ellipsis: true,
|
|
||||||
responsive: ["md"],
|
|
||||||
},
|
|
||||||
// {
|
|
||||||
// title: t("jobs.fields.owner_owing"),
|
|
||||||
// dataIndex: "owner_owing",
|
|
||||||
// key: "owner_owing",
|
|
||||||
// responsive: ["md"],
|
|
||||||
// render: (text, record) => (
|
|
||||||
// <CurrencyFormatter>{record.owner_owing}</CurrencyFormatter>
|
|
||||||
// ),
|
|
||||||
// },
|
|
||||||
];
|
|
||||||
|
|
||||||
const scrollMapper = {
|
|
||||||
xs: true,
|
|
||||||
sm: true,
|
|
||||||
md: true,
|
|
||||||
lg: "100%",
|
|
||||||
xl: "100%",
|
|
||||||
xxl: "100%",
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Card
|
|
||||||
title={t("titles.bc.jobs-active")}
|
|
||||||
extra={
|
|
||||||
<Space wrap>
|
|
||||||
<Button onClick={() => refetch()}>
|
|
||||||
<SyncOutlined />
|
|
||||||
</Button>
|
|
||||||
<Input.Search
|
|
||||||
placeholder={t("general.labels.search")}
|
|
||||||
onChange={(e) => {
|
|
||||||
setSearchText(e.target.value);
|
|
||||||
}}
|
|
||||||
value={searchText}
|
|
||||||
enterButton
|
|
||||||
/>
|
|
||||||
</Space>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<Table
|
|
||||||
loading={loading}
|
|
||||||
pagination={{ defaultPageSize: 50 }}
|
|
||||||
columns={columns}
|
|
||||||
rowKey="id"
|
|
||||||
dataSource={jobs}
|
|
||||||
scroll={{
|
|
||||||
x: selectedBreakpoint ? scrollMapper[selectedBreakpoint[0]] : "100%",
|
|
||||||
}}
|
|
||||||
rowSelection={{
|
|
||||||
onSelect: (record) => {
|
|
||||||
handleOnRowClick(record);
|
|
||||||
},
|
|
||||||
selectedRowKeys: [selected],
|
|
||||||
type: "radio",
|
|
||||||
}}
|
|
||||||
onChange={handleTableChange}
|
|
||||||
onRow={(record, rowIndex) => {
|
|
||||||
return {
|
|
||||||
onClick: (event) => {
|
|
||||||
handleOnRowClick(record);
|
|
||||||
},
|
|
||||||
};
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</Card>
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(mapStateToProps, null)(JobsList);
|
export default connect(mapStateToProps, null)(JobsList);
|
||||||
|
|||||||
@@ -16,11 +16,12 @@ import { QUERY_ALL_ACTIVE_JOBS } from "../../graphql/jobs.queries";
|
|||||||
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 { onlyUnique } from "../../utils/arrayHelper";
|
import { onlyUnique } from "../../utils/arrayHelper";
|
||||||
import { alphaSort } from "../../utils/sorters";
|
import { pageLimit } from "../../utils/config";
|
||||||
|
import { alphaSort, statusSort } from "../../utils/sorters";
|
||||||
|
import useLocalStorage from "../../utils/useLocalStorage";
|
||||||
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";
|
import OwnerNameDisplay from "../owner-name-display/owner-name-display.component";
|
||||||
import {pageLimit} from "../../utils/config";
|
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
@@ -53,10 +54,8 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
});
|
});
|
||||||
|
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({ sortedInfo: {} });
|
||||||
sortedInfo: {},
|
const [filter, setFilter] = useLocalStorage("filter_jobs_ready", null);
|
||||||
filteredInfo: { text: "" },
|
|
||||||
});
|
|
||||||
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
@@ -105,7 +104,8 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
: [];
|
: [];
|
||||||
|
|
||||||
const handleTableChange = (pagination, filters, sorter) => {
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
setState({ ...state, sortedInfo: sorter });
|
||||||
|
setFilter(filters);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOnRowClick = (record) => {
|
const handleOnRowClick = (record) => {
|
||||||
@@ -129,7 +129,6 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
sorter: (a, b) => alphaSort(a.ro_number, b.ro_number),
|
sorter: (a, b) => alphaSort(a.ro_number, b.ro_number),
|
||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "ro_number" && state.sortedInfo.order,
|
||||||
|
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<Link
|
<Link
|
||||||
to={"/manage/jobs/" + record.id}
|
to={"/manage/jobs/" + record.id}
|
||||||
@@ -157,7 +156,6 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
dataIndex: "owner",
|
dataIndex: "owner",
|
||||||
key: "owner",
|
key: "owner",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
|
||||||
responsive: ["md"],
|
responsive: ["md"],
|
||||||
sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
||||||
sortOrder:
|
sortOrder:
|
||||||
@@ -197,16 +195,15 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
<ChatOpenButton phone={record.ownr_ph2} jobid={record.id} />
|
<ChatOpenButton phone={record.ownr_ph2} jobid={record.id} />
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.status"),
|
title: t("jobs.fields.status"),
|
||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
key: "status",
|
key: "status",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
|
||||||
sorter: (a, b) => alphaSort(a.status, b.status),
|
sorter: (a, b) => alphaSort(a.status, b.status),
|
||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||||
|
filteredValue: filter?.status || null,
|
||||||
filters:
|
filters:
|
||||||
(jobs &&
|
(jobs &&
|
||||||
jobs
|
jobs
|
||||||
@@ -217,11 +214,17 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
text: s || "No Status*",
|
text: s || "No Status*",
|
||||||
value: [s],
|
value: [s],
|
||||||
};
|
};
|
||||||
})) ||
|
})
|
||||||
|
.sort((a, b) =>
|
||||||
|
statusSort(
|
||||||
|
a.text,
|
||||||
|
b.text,
|
||||||
|
bodyshop.md_ro_statuses.active_statuses
|
||||||
|
)
|
||||||
|
)) ||
|
||||||
[],
|
[],
|
||||||
onFilter: (value, record) => value.includes(record.status),
|
onFilter: (value, record) => value.includes(record.status),
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.vehicle"),
|
title: t("jobs.fields.vehicle"),
|
||||||
dataIndex: "vehicle",
|
dataIndex: "vehicle",
|
||||||
@@ -274,6 +277,7 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
dataIndex: "ins_co_nm",
|
dataIndex: "ins_co_nm",
|
||||||
key: "ins_co_nm",
|
key: "ins_co_nm",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
filteredValue: filter?.ins_co_nm || null,
|
||||||
filters:
|
filters:
|
||||||
(jobs &&
|
(jobs &&
|
||||||
jobs
|
jobs
|
||||||
@@ -281,10 +285,11 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
.filter(onlyUnique)
|
.filter(onlyUnique)
|
||||||
.map((s) => {
|
.map((s) => {
|
||||||
return {
|
return {
|
||||||
text: s,
|
text: s || "No Ins Co.*",
|
||||||
value: [s],
|
value: [s],
|
||||||
};
|
};
|
||||||
})) ||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
[],
|
[],
|
||||||
onFilter: (value, record) => value.includes(record.ins_co_nm),
|
onFilter: (value, record) => value.includes(record.ins_co_nm),
|
||||||
responsive: ["md"],
|
responsive: ["md"],
|
||||||
@@ -295,7 +300,6 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
key: "clm_total",
|
key: "clm_total",
|
||||||
responsive: ["md"],
|
responsive: ["md"],
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
|
|
||||||
sorter: (a, b) => a.clm_total - b.clm_total,
|
sorter: (a, b) => a.clm_total - b.clm_total,
|
||||||
sortOrder:
|
sortOrder:
|
||||||
state.sortedInfo.columnKey === "clm_total" && state.sortedInfo.order,
|
state.sortedInfo.columnKey === "clm_total" && state.sortedInfo.order,
|
||||||
@@ -306,9 +310,10 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
{
|
{
|
||||||
title: t("jobs.labels.estimator"),
|
title: t("jobs.labels.estimator"),
|
||||||
dataIndex: "jobs.labels.estimator",
|
dataIndex: "jobs.labels.estimator",
|
||||||
key: "jobs.labels.estimator",
|
key: "estimator",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
responsive: ["xl"],
|
responsive: ["xl"],
|
||||||
|
filteredValue: filter?.estimator || null,
|
||||||
filterSearch: true,
|
filterSearch: true,
|
||||||
filters:
|
filters:
|
||||||
(jobs &&
|
(jobs &&
|
||||||
@@ -317,10 +322,11 @@ export function JobsReadyList({ bodyshop }) {
|
|||||||
.filter(onlyUnique)
|
.filter(onlyUnique)
|
||||||
.map((s) => {
|
.map((s) => {
|
||||||
return {
|
return {
|
||||||
text: s || "N/A",
|
text: s || "No Estimator*",
|
||||||
value: [s],
|
value: [s],
|
||||||
};
|
};
|
||||||
})) ||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
[],
|
[],
|
||||||
onFilter: (value, record) =>
|
onFilter: (value, record) =>
|
||||||
value.includes(
|
value.includes(
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Space, Tag } from "antd";
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
|
|
||||||
export default function JobsRelatedRos({ jobid, job }) {
|
export default function JobsRelatedRos({ jobid, job, disabled }) {
|
||||||
if (!(job && job.vehicle && job.vehicle.jobs)) return null;
|
if (!(job && job.vehicle && job.vehicle.jobs)) return null;
|
||||||
return (
|
return (
|
||||||
<Space wrap>
|
<Space wrap>
|
||||||
@@ -10,9 +10,15 @@ export default function JobsRelatedRos({ jobid, job }) {
|
|||||||
.filter((j) => j.id !== job.id)
|
.filter((j) => j.id !== job.id)
|
||||||
.map((j) => (
|
.map((j) => (
|
||||||
<Tag key={j.id}>
|
<Tag key={j.id}>
|
||||||
<Link to={`/manage/jobs/${j?.id}`}>{`${j.ro_number || "N/A"}${
|
{disabled ? (
|
||||||
j.clm_no ? ` | ${j.clm_no}` : ""
|
<>{`${j.ro_number || "N/A"}${j.clm_no ? ` | ${j.clm_no}` : ""}${
|
||||||
}${j.status ? ` | ${j.status}` : ""}`}</Link>
|
j.status ? ` | ${j.status}` : ""
|
||||||
|
}`}</>
|
||||||
|
) : (
|
||||||
|
<Link to={`/manage/jobs/${j?.id}`}>{`${j.ro_number || "N/A"}${
|
||||||
|
j.clm_no ? ` | ${j.clm_no}` : ""
|
||||||
|
}${j.status ? ` | ${j.status}` : ""}`}</Link>
|
||||||
|
)}
|
||||||
</Tag>
|
</Tag>
|
||||||
))}
|
))}
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
@@ -0,0 +1,333 @@
|
|||||||
|
import {
|
||||||
|
Button,
|
||||||
|
Card,
|
||||||
|
Col,
|
||||||
|
Row,
|
||||||
|
Space,
|
||||||
|
Table,
|
||||||
|
Typography,
|
||||||
|
notification,
|
||||||
|
} from "antd";
|
||||||
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
|
import axios from "axios";
|
||||||
|
import _ from "lodash";
|
||||||
|
import React, { useEffect, useMemo, useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectTechnician } from "../../redux/tech/tech.selectors";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
|
import "./labor-allocations-table.styles.scss";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
technician: selectTechnician,
|
||||||
|
});
|
||||||
|
|
||||||
|
export function PayrollLaborAllocationsTable({
|
||||||
|
jobId,
|
||||||
|
joblines,
|
||||||
|
timetickets,
|
||||||
|
bodyshop,
|
||||||
|
adjustments,
|
||||||
|
technician,
|
||||||
|
refetch,
|
||||||
|
}) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [totals, setTotals] = useState([]);
|
||||||
|
const [state, setState] = useState({
|
||||||
|
sortedInfo: {
|
||||||
|
columnKey: "cost_center",
|
||||||
|
field: "cost_center",
|
||||||
|
order: "ascend",
|
||||||
|
},
|
||||||
|
filteredInfo: {},
|
||||||
|
});
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
async function CalculateTotals() {
|
||||||
|
const { data } = await axios.post("/payroll/calculatelabor", {
|
||||||
|
jobid: jobId,
|
||||||
|
});
|
||||||
|
setTotals(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!!joblines && !!timetickets && !!bodyshop) {
|
||||||
|
CalculateTotals();
|
||||||
|
}
|
||||||
|
if (!jobId) setTotals([]);
|
||||||
|
}, [joblines, timetickets, bodyshop, adjustments, jobId]);
|
||||||
|
|
||||||
|
const convertedLines = useMemo(
|
||||||
|
() => joblines && joblines.filter((j) => j.convertedtolbr),
|
||||||
|
[joblines]
|
||||||
|
);
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t("timetickets.fields.employee"),
|
||||||
|
dataIndex: "employeeid",
|
||||||
|
key: "employeeid",
|
||||||
|
render: (text, record) => {
|
||||||
|
if (record.employeeid === undefined) {
|
||||||
|
return (
|
||||||
|
<span style={{ color: "tomato", fontWeight: "bolder" }}>
|
||||||
|
{t("timetickets.labels.unassigned")}
|
||||||
|
</span>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
const emp = bodyshop.employees.find((e) => e.id === record.employeeid);
|
||||||
|
return `${emp?.first_name} ${emp?.last_name}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.mod_lbr_ty"),
|
||||||
|
dataIndex: "mod_lbr_ty",
|
||||||
|
key: "mod_lbr_ty",
|
||||||
|
render: (text, record) =>
|
||||||
|
record.employeeid === undefined ? (
|
||||||
|
<span style={{ color: "tomato", fontWeight: "bolder" }}>
|
||||||
|
{t("timetickets.labels.unassigned")}
|
||||||
|
</span>
|
||||||
|
) : (
|
||||||
|
t(`joblines.fields.lbr_types.${record.mod_lbr_ty?.toUpperCase()}`)
|
||||||
|
),
|
||||||
|
},
|
||||||
|
// {
|
||||||
|
// title: t("timetickets.fields.rate"),
|
||||||
|
// dataIndex: "rate",
|
||||||
|
// key: "rate",
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
title: t("jobs.labels.hrs_total"),
|
||||||
|
dataIndex: "expectedHours",
|
||||||
|
key: "expectedHours",
|
||||||
|
sorter: (a, b) => a.expectedHours - b.expectedHours,
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "expectedHours" &&
|
||||||
|
state.sortedInfo.order,
|
||||||
|
render: (text, record) => record.expectedHours.toFixed(5),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.labels.hrs_claimed"),
|
||||||
|
dataIndex: "claimedHours",
|
||||||
|
key: "claimedHours",
|
||||||
|
sorter: (a, b) => a.claimedHours - b.claimedHours,
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "claimedHours" && state.sortedInfo.order,
|
||||||
|
render: (text, record) =>
|
||||||
|
record.claimedHours && record.claimedHours.toFixed(5),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.labels.difference"),
|
||||||
|
dataIndex: "difference",
|
||||||
|
|
||||||
|
key: "difference",
|
||||||
|
sorter: (a, b) => a.difference - b.difference,
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "difference" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => {
|
||||||
|
const difference = _.round(
|
||||||
|
record.expectedHours - record.claimedHours,
|
||||||
|
5
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<strong
|
||||||
|
style={{
|
||||||
|
color: difference >= 0 ? "green" : "red",
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{difference}
|
||||||
|
</strong>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
const convertedTableCols = [
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.line_desc"),
|
||||||
|
dataIndex: "line_desc",
|
||||||
|
key: "line_desc",
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.op_code_desc"),
|
||||||
|
dataIndex: "op_code_desc",
|
||||||
|
key: "op_code_desc",
|
||||||
|
ellipsis: true,
|
||||||
|
render: (text, record) =>
|
||||||
|
`${record.op_code_desc || ""}${
|
||||||
|
record.alt_partm ? ` ${record.alt_partm}` : ""
|
||||||
|
}`,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.act_price"),
|
||||||
|
dataIndex: "act_price",
|
||||||
|
key: "act_price",
|
||||||
|
ellipsis: true,
|
||||||
|
render: (text, record) => (
|
||||||
|
<>
|
||||||
|
<CurrencyFormatter>
|
||||||
|
{record.db_ref === "900510" || record.db_ref === "900511"
|
||||||
|
? record.prt_dsmk_m
|
||||||
|
: record.act_price}
|
||||||
|
</CurrencyFormatter>
|
||||||
|
{record.prt_dsmk_p && record.prt_dsmk_p !== 0 ? (
|
||||||
|
<span
|
||||||
|
style={{ marginLeft: ".2rem" }}
|
||||||
|
>{`(${record.prt_dsmk_p}%)`}</span>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.part_qty"),
|
||||||
|
dataIndex: "part_qty",
|
||||||
|
key: "part_qty",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.mod_lbr_ty"),
|
||||||
|
dataIndex: "conv_mod_lbr_ty",
|
||||||
|
key: "conv_mod_lbr_ty",
|
||||||
|
render: (text, record) =>
|
||||||
|
record.convertedtolbr_data && record.convertedtolbr_data.mod_lbr_ty,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.mod_lb_hrs"),
|
||||||
|
dataIndex: "conv_mod_lb_hrs",
|
||||||
|
key: "conv_mod_lb_hrs",
|
||||||
|
render: (text, record) =>
|
||||||
|
record.convertedtolbr_data &&
|
||||||
|
record.convertedtolbr_data.mod_lb_hrs &&
|
||||||
|
record.convertedtolbr_data.mod_lb_hrs.toFixed(5),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
|
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||||
|
};
|
||||||
|
|
||||||
|
const summary =
|
||||||
|
totals &&
|
||||||
|
totals.reduce(
|
||||||
|
(acc, val) => {
|
||||||
|
acc.hrs_total += val.expectedHours;
|
||||||
|
acc.hrs_claimed += val.claimedHours;
|
||||||
|
// acc.adjustments += val.adjustments;
|
||||||
|
acc.difference += val.expectedHours - val.claimedHours;
|
||||||
|
return acc;
|
||||||
|
},
|
||||||
|
{ hrs_total: 0, hrs_claimed: 0, adjustments: 0, difference: 0 }
|
||||||
|
);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={24}>
|
||||||
|
<Card
|
||||||
|
title={t("jobs.labels.laborallocations")}
|
||||||
|
extra={
|
||||||
|
<Space>
|
||||||
|
<Button
|
||||||
|
onClick={async () => {
|
||||||
|
const response = await axios.post("/payroll/payall", {
|
||||||
|
jobid: jobId,
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.status === 200) {
|
||||||
|
if (response.data.success !== false) {
|
||||||
|
notification.open({
|
||||||
|
type: "success",
|
||||||
|
message: t("timetickets.successes.payall"),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
notification.open({
|
||||||
|
type: "error",
|
||||||
|
message: t("timetickets.errors.payall", {
|
||||||
|
error: response.data.error,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (refetch) refetch();
|
||||||
|
} else {
|
||||||
|
notification.open({
|
||||||
|
type: "error",
|
||||||
|
message: t("timetickets.errors.payall", {
|
||||||
|
error: JSON.stringify(""),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{t("timetickets.actions.payall")}
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
onClick={async () => {
|
||||||
|
const { data } = await axios.post("/payroll/calculatelabor", {
|
||||||
|
jobid: jobId,
|
||||||
|
});
|
||||||
|
setTotals(data);
|
||||||
|
refetch();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<SyncOutlined />
|
||||||
|
</Button>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Table
|
||||||
|
columns={columns}
|
||||||
|
rowKey={(record) => `${record.employeeid} ${record.mod_lbr_ty}`}
|
||||||
|
pagination={false}
|
||||||
|
onChange={handleTableChange}
|
||||||
|
dataSource={totals}
|
||||||
|
scroll={{
|
||||||
|
x: true,
|
||||||
|
}}
|
||||||
|
summary={() => (
|
||||||
|
<Table.Summary.Row>
|
||||||
|
<Table.Summary.Cell>
|
||||||
|
<Typography.Title level={4}>
|
||||||
|
{t("general.labels.totals")}
|
||||||
|
</Typography.Title>
|
||||||
|
</Table.Summary.Cell>
|
||||||
|
<Table.Summary.Cell></Table.Summary.Cell>
|
||||||
|
<Table.Summary.Cell>
|
||||||
|
{summary.hrs_total.toFixed(5)}
|
||||||
|
</Table.Summary.Cell>
|
||||||
|
<Table.Summary.Cell>
|
||||||
|
{summary.hrs_claimed.toFixed(5)}
|
||||||
|
</Table.Summary.Cell>
|
||||||
|
|
||||||
|
<Table.Summary.Cell>
|
||||||
|
{summary.difference.toFixed(5)}
|
||||||
|
</Table.Summary.Cell>
|
||||||
|
</Table.Summary.Row>
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
{convertedLines && convertedLines.length > 0 && (
|
||||||
|
<Col span={24}>
|
||||||
|
<Card title={t("jobs.labels.convertedtolabor")}>
|
||||||
|
<Table
|
||||||
|
columns={convertedTableCols}
|
||||||
|
rowKey="id"
|
||||||
|
pagination={false}
|
||||||
|
dataSource={convertedLines}
|
||||||
|
scroll={{
|
||||||
|
x: true,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
</Col>
|
||||||
|
)}
|
||||||
|
</Row>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default connect(mapStateToProps, null)(PayrollLaborAllocationsTable);
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
import { useMutation } from "@apollo/client";
|
||||||
|
import { Button, Card, Col, Row, Table, notification } from "antd";
|
||||||
|
import moment from "moment-business-days";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { UPDATE_PARTS_DISPATCH_LINE } from "../../graphql/parts-dispatch.queries";
|
||||||
|
import { DateTimeFormatter } from "../../utils/DateFormatter";
|
||||||
|
|
||||||
|
export default function PartsDispatchExpander({ dispatch, job }) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [updateDispatchLine] = useMutation(UPDATE_PARTS_DISPATCH_LINE);
|
||||||
|
|
||||||
|
const handleAccept = async ({ partsDispatchLineId }) => {
|
||||||
|
const accepted_at = moment();
|
||||||
|
const result = await updateDispatchLine({
|
||||||
|
variables: { id: partsDispatchLineId, line: { accepted_at } },
|
||||||
|
optimisticResponse: {
|
||||||
|
update_parts_dispatch_lines_by_pk: {
|
||||||
|
accepted_at,
|
||||||
|
id: partsDispatchLineId,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
if (result.errors) {
|
||||||
|
notification.open({
|
||||||
|
type: "error",
|
||||||
|
message: t("parts_dispatch.errors.accepting", {
|
||||||
|
error: JSON.stringify(result.errors),
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.part_qty"),
|
||||||
|
dataIndex: "quantity",
|
||||||
|
key: "quantity",
|
||||||
|
width: "10%",
|
||||||
|
//sorter: (a, b) => alphaSort(a.number, b.number),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.line_desc"),
|
||||||
|
dataIndex: "joblineid",
|
||||||
|
key: "joblineid",
|
||||||
|
//sorter: (a, b) => alphaSort(a.number, b.number),
|
||||||
|
render: (text, record) => record.jobline.line_desc,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("parts_dispatch_lines.fields.accepted_at"),
|
||||||
|
dataIndex: "accepted_at",
|
||||||
|
key: "accepted_at",
|
||||||
|
width: "20%",
|
||||||
|
|
||||||
|
//sorter: (a, b) => alphaSort(a.number, b.number),
|
||||||
|
render: (text, record) =>
|
||||||
|
record.accepted_at ? (
|
||||||
|
<DateTimeFormatter>{record.accepted_at}</DateTimeFormatter>
|
||||||
|
) : (
|
||||||
|
<Button
|
||||||
|
onClick={() => handleAccept({ partsDispatchLineId: record.id })}
|
||||||
|
>
|
||||||
|
{t("parts_dispatch.actions.accept")}
|
||||||
|
</Button>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return (
|
||||||
|
<Card>
|
||||||
|
<Row gutter={[16, 16]}>
|
||||||
|
<Col span={24}>
|
||||||
|
<Table
|
||||||
|
rowKey={"id"}
|
||||||
|
dataSource={dispatch.parts_dispatch_lines}
|
||||||
|
columns={columns}
|
||||||
|
/>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,155 @@
|
|||||||
|
import {
|
||||||
|
MinusCircleTwoTone,
|
||||||
|
PlusCircleTwoTone,
|
||||||
|
SyncOutlined,
|
||||||
|
} from "@ant-design/icons";
|
||||||
|
import { Button, Card, Input, Space, Table } from "antd";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import { TemplateList } from "../../utils/TemplateConstants";
|
||||||
|
import { alphaSort } from "../../utils/sorters";
|
||||||
|
import PartsDispatchExpander from "../parts-dispatch-expander/parts-dispatch-expander.component";
|
||||||
|
import PrintWrapperComponent from "../print-wrapper/print-wrapper.component";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => ({});
|
||||||
|
|
||||||
|
export function PartDispatchTableComponent({
|
||||||
|
bodyshop,
|
||||||
|
jobRO,
|
||||||
|
job,
|
||||||
|
billsQuery,
|
||||||
|
handleOnRowClick,
|
||||||
|
}) {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const [state, setState] = useState({
|
||||||
|
sortedInfo: {},
|
||||||
|
});
|
||||||
|
// const search = queryString.parse(useLocation().search);
|
||||||
|
// const selectedBill = search.billid;
|
||||||
|
const [searchText, setSearchText] = useState("");
|
||||||
|
|
||||||
|
const Templates = TemplateList("job_special");
|
||||||
|
|
||||||
|
const { refetch } = billsQuery;
|
||||||
|
|
||||||
|
const recordActions = (record) => (
|
||||||
|
<Space wrap>
|
||||||
|
<PrintWrapperComponent
|
||||||
|
templateObject={{
|
||||||
|
name: Templates.parts_dispatch.key,
|
||||||
|
variables: { id: record.id },
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
);
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: t("parts_dispatch.fields.number"),
|
||||||
|
dataIndex: "number",
|
||||||
|
key: "number",
|
||||||
|
sorter: (a, b) => alphaSort(a.number, b.number),
|
||||||
|
width: "10%",
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "number" && state.sortedInfo.order,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("timetickets.fields.employee"),
|
||||||
|
dataIndex: "employeeid",
|
||||||
|
key: "employeeid",
|
||||||
|
sorter: (a, b) => alphaSort(a.employeeid, b.employeeid),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "employeeid" && state.sortedInfo.order,
|
||||||
|
render: (text, record) => {
|
||||||
|
const e = bodyshop.employees.find((e) => e.id === record.employeeid);
|
||||||
|
return `${e?.first_name || ""} ${e?.last_name || ""}`.trim();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("parts_dispatch.fields.percent_accepted"),
|
||||||
|
dataIndex: "percent_accepted",
|
||||||
|
key: "percent_accepted",
|
||||||
|
|
||||||
|
render: (text, record) =>
|
||||||
|
record.parts_dispatch_lines.length > 0
|
||||||
|
? `
|
||||||
|
${(
|
||||||
|
(record.parts_dispatch_lines.filter((l) => l.accepted_at)
|
||||||
|
.length /
|
||||||
|
record.parts_dispatch_lines.length) *
|
||||||
|
100
|
||||||
|
).toFixed(0)}%`
|
||||||
|
: "0%",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("general.labels.actions"),
|
||||||
|
dataIndex: "actions",
|
||||||
|
key: "actions",
|
||||||
|
width: "10%",
|
||||||
|
render: (text, record) => recordActions(record, true),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
|
setState({ ...state, filteredInfo: filters, sortedInfo: sorter });
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card
|
||||||
|
title={t("parts_dispatch.labels.parts_dispatch")}
|
||||||
|
extra={
|
||||||
|
<Space wrap>
|
||||||
|
<Button onClick={() => refetch()}>
|
||||||
|
<SyncOutlined />
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<Input.Search
|
||||||
|
placeholder={t("general.labels.search")}
|
||||||
|
value={searchText}
|
||||||
|
onChange={(e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
setSearchText(e.target.value);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<Table
|
||||||
|
loading={billsQuery.loading}
|
||||||
|
scroll={{
|
||||||
|
x: true, // y: "50rem"
|
||||||
|
}}
|
||||||
|
expandable={{
|
||||||
|
expandedRowRender: (record) => (
|
||||||
|
<PartsDispatchExpander dispatch={record} job={job} />
|
||||||
|
),
|
||||||
|
rowExpandable: (record) => true,
|
||||||
|
|
||||||
|
expandIcon: ({ expanded, onExpand, record }) =>
|
||||||
|
expanded ? (
|
||||||
|
<MinusCircleTwoTone onClick={(e) => onExpand(record, e)} />
|
||||||
|
) : (
|
||||||
|
<PlusCircleTwoTone onClick={(e) => onExpand(record, e)} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
columns={columns}
|
||||||
|
rowKey="id"
|
||||||
|
dataSource={billsQuery.data ? billsQuery.data.parts_dispatch : []}
|
||||||
|
onChange={handleTableChange}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(PartDispatchTableComponent);
|
||||||
@@ -0,0 +1,77 @@
|
|||||||
|
import { useQuery } from "@apollo/client";
|
||||||
|
import { Card, Divider, Drawer, Grid } from "antd";
|
||||||
|
import queryString from "query-string";
|
||||||
|
import React from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { Link, useHistory, useLocation } from "react-router-dom";
|
||||||
|
import { QUERY_PARTS_QUEUE_CARD_DETAILS } from "../../graphql/jobs.queries";
|
||||||
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
import JobsDetailHeader from "../jobs-detail-header/jobs-detail-header.component";
|
||||||
|
import LoadingSpinner from "../loading-spinner/loading-spinner.component";
|
||||||
|
import PartsQueueJobLinesComponent from "./parts-queue-job-lines.component";
|
||||||
|
|
||||||
|
export default function PartsQueueDetailCard() {
|
||||||
|
const selectedBreakpoint = Object.entries(Grid.useBreakpoint())
|
||||||
|
.filter((screen) => !!screen[1])
|
||||||
|
.slice(-1)[0];
|
||||||
|
|
||||||
|
const bpoints = {
|
||||||
|
xs: "100%",
|
||||||
|
sm: "100%",
|
||||||
|
md: "100%",
|
||||||
|
lg: "75%",
|
||||||
|
xl: "75%",
|
||||||
|
xxl: "60%",
|
||||||
|
};
|
||||||
|
const drawerPercentage = selectedBreakpoint
|
||||||
|
? bpoints[selectedBreakpoint[0]]
|
||||||
|
: "100%";
|
||||||
|
|
||||||
|
const searchParams = queryString.parse(useLocation().search);
|
||||||
|
const { selected } = searchParams;
|
||||||
|
const history = useHistory();
|
||||||
|
const { loading, error, data } = useQuery(QUERY_PARTS_QUEUE_CARD_DETAILS, {
|
||||||
|
variables: { id: selected },
|
||||||
|
skip: !selected,
|
||||||
|
fetchPolicy: "network-only",
|
||||||
|
nextFetchPolicy: "network-only",
|
||||||
|
});
|
||||||
|
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const handleDrawerClose = () => {
|
||||||
|
delete searchParams.selected;
|
||||||
|
history.push({
|
||||||
|
search: queryString.stringify({
|
||||||
|
...searchParams,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Drawer
|
||||||
|
visible={!!selected}
|
||||||
|
destroyOnClose
|
||||||
|
width={drawerPercentage}
|
||||||
|
placement="right"
|
||||||
|
onClose={handleDrawerClose}
|
||||||
|
>
|
||||||
|
{loading ? <LoadingSpinner /> : null}
|
||||||
|
{error ? <AlertComponent message={error.message} type="error" /> : null}
|
||||||
|
{data ? (
|
||||||
|
<Card
|
||||||
|
title={
|
||||||
|
<Link to={`/manage/jobs/${data.jobs_by_pk.id}`}>
|
||||||
|
{data.jobs_by_pk.ro_number || t("general.labels.na")}
|
||||||
|
</Link>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<JobsDetailHeader job={data ? data.jobs_by_pk : null} />
|
||||||
|
<Divider type="horizontal" />
|
||||||
|
<PartsQueueJobLinesComponent
|
||||||
|
jobLines={data.jobs_by_pk ? data.jobs_by_pk.joblines : null}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
) : null}
|
||||||
|
</Drawer>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -0,0 +1,208 @@
|
|||||||
|
import { Card, Table } from "antd";
|
||||||
|
import React, { useState } from "react";
|
||||||
|
import { useTranslation } from "react-i18next";
|
||||||
|
import { connect } from "react-redux";
|
||||||
|
import { createStructuredSelector } from "reselect";
|
||||||
|
import { selectJobReadOnly } from "../../redux/application/application.selectors";
|
||||||
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
|
import CurrencyFormatter from "../../utils/CurrencyFormatter";
|
||||||
|
import { onlyUnique } from "../../utils/arrayHelper";
|
||||||
|
import { alphaSort } from "../../utils/sorters";
|
||||||
|
|
||||||
|
const mapStateToProps = createStructuredSelector({
|
||||||
|
bodyshop: selectBodyshop,
|
||||||
|
jobRO: selectJobReadOnly,
|
||||||
|
});
|
||||||
|
|
||||||
|
const mapDispatchToProps = (dispatch) => ({});
|
||||||
|
|
||||||
|
export function PartsQueueJobLinesComponent({ jobRO, loading, jobLines }) {
|
||||||
|
const [state, setState] = useState({
|
||||||
|
sortedInfo: {},
|
||||||
|
filteredInfo: {},
|
||||||
|
});
|
||||||
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const columns = [
|
||||||
|
{
|
||||||
|
title: "#",
|
||||||
|
dataIndex: "line_no",
|
||||||
|
key: "line_no",
|
||||||
|
sorter: (a, b) => a.line_no - b.line_no,
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "line_no" && state.sortedInfo.order,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.line_desc"),
|
||||||
|
dataIndex: "line_desc",
|
||||||
|
key: "line_desc",
|
||||||
|
sorter: (a, b) => alphaSort(a.line_desc, b.line_desc),
|
||||||
|
onCell: (record) => ({
|
||||||
|
className: record.manual_line && "job-line-manual",
|
||||||
|
style: {
|
||||||
|
...(record.critical ? { boxShadow: " -.5em 0 0 #FFC107" } : {}),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "line_desc" && state.sortedInfo.order,
|
||||||
|
ellipsis: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.oem_partno"),
|
||||||
|
dataIndex: "oem_partno",
|
||||||
|
key: "oem_partno",
|
||||||
|
sorter: (a, b) => alphaSort(a.oem_partno, b.oem_partno),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "oem_partno" && state.sortedInfo.order,
|
||||||
|
ellipsis: true,
|
||||||
|
render: (text, record) =>
|
||||||
|
`${record.oem_partno || ""} ${
|
||||||
|
record.alt_partno ? `(${record.alt_partno})` : ""
|
||||||
|
}`.trim(),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.part_type"),
|
||||||
|
dataIndex: "part_type",
|
||||||
|
key: "part_type",
|
||||||
|
filteredValue: state.filteredInfo.part_type || null,
|
||||||
|
sorter: (a, b) => alphaSort(a.part_type, b.part_type),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "part_type" && state.sortedInfo.order,
|
||||||
|
filters: [
|
||||||
|
{
|
||||||
|
text: t("jobs.labels.partsfilter"),
|
||||||
|
value: [
|
||||||
|
"PAN",
|
||||||
|
"PAC",
|
||||||
|
"PAR",
|
||||||
|
"PAL",
|
||||||
|
"PAA",
|
||||||
|
"PAM",
|
||||||
|
"PAP",
|
||||||
|
"PAS",
|
||||||
|
"PASL",
|
||||||
|
"PAG",
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t("joblines.fields.part_types.PAN"),
|
||||||
|
value: ["PAN"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t("joblines.fields.part_types.PAP"),
|
||||||
|
value: ["PAP"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t("joblines.fields.part_types.PAL"),
|
||||||
|
value: ["PAL"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t("joblines.fields.part_types.PAA"),
|
||||||
|
value: ["PAA"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t("joblines.fields.part_types.PAG"),
|
||||||
|
value: ["PAG"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t("joblines.fields.part_types.PAS"),
|
||||||
|
value: ["PAS"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t("joblines.fields.part_types.PASL"),
|
||||||
|
value: ["PASL"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t("joblines.fields.part_types.PAC"),
|
||||||
|
value: ["PAC"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t("joblines.fields.part_types.PAR"),
|
||||||
|
value: ["PAR"],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
text: t("joblines.fields.part_types.PAM"),
|
||||||
|
value: ["PAM"],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
onFilter: (value, record) => value.includes(record.part_type),
|
||||||
|
render: (text, record) =>
|
||||||
|
record.part_type
|
||||||
|
? t(`joblines.fields.part_types.${record.part_type}`)
|
||||||
|
: null,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.part_qty"),
|
||||||
|
dataIndex: "part_qty",
|
||||||
|
key: "part_qty",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.act_price"),
|
||||||
|
dataIndex: "act_price",
|
||||||
|
key: "act_price",
|
||||||
|
sorter: (a, b) => a.act_price - b.act_price,
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "act_price" && state.sortedInfo.order,
|
||||||
|
ellipsis: true,
|
||||||
|
render: (text, record) => (
|
||||||
|
<CurrencyFormatter>
|
||||||
|
{record.db_ref === "900510" || record.db_ref === "900511"
|
||||||
|
? record.prt_dsmk_m
|
||||||
|
: record.act_price}
|
||||||
|
</CurrencyFormatter>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.location"),
|
||||||
|
dataIndex: "location",
|
||||||
|
key: "location",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("joblines.fields.status"),
|
||||||
|
dataIndex: "status",
|
||||||
|
key: "status",
|
||||||
|
sorter: (a, b) => alphaSort(a.status, b.status),
|
||||||
|
sortOrder:
|
||||||
|
state.sortedInfo.columnKey === "status" && state.sortedInfo.order,
|
||||||
|
filteredValue: state.filteredInfo.status || null,
|
||||||
|
filters:
|
||||||
|
(jobLines &&
|
||||||
|
jobLines
|
||||||
|
.map((l) => l.status)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Status*",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.status),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
const handleTableChange = (pagination, filters, sorter) => {
|
||||||
|
setState((state) => ({
|
||||||
|
...state,
|
||||||
|
filteredInfo: filters,
|
||||||
|
sortedInfo: sorter,
|
||||||
|
}));
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Card title={t("jobs.labels.parts_lines")}>
|
||||||
|
<Table
|
||||||
|
columns={columns}
|
||||||
|
rowKey="id"
|
||||||
|
loading={loading}
|
||||||
|
pagination={false}
|
||||||
|
dataSource={jobLines}
|
||||||
|
onChange={handleTableChange}
|
||||||
|
/>
|
||||||
|
</Card>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
export default connect(
|
||||||
|
mapStateToProps,
|
||||||
|
mapDispatchToProps
|
||||||
|
)(PartsQueueJobLinesComponent);
|
||||||
@@ -8,30 +8,28 @@ import { useTranslation } from "react-i18next";
|
|||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
import { Link, useHistory, useLocation } from "react-router-dom";
|
import { Link, useHistory, useLocation } from "react-router-dom";
|
||||||
import { createStructuredSelector } from "reselect";
|
import { createStructuredSelector } from "reselect";
|
||||||
import AlertComponent from "../../components/alert/alert.component";
|
|
||||||
import JobPartsQueueCount from "../../components/job-parts-queue-count/job-parts-queue-count.component";
|
|
||||||
import JobRemoveFromPartsQueue from "../../components/job-remove-from-parst-queue/job-remove-from-parts-queue.component";
|
|
||||||
import OwnerNameDisplay from "../../components/owner-name-display/owner-name-display.component";
|
|
||||||
import ProductionListColumnComment from "../../components/production-list-columns/production-list-columns.comment.component";
|
|
||||||
import { QUERY_PARTS_QUEUE } from "../../graphql/jobs.queries";
|
import { QUERY_PARTS_QUEUE } from "../../graphql/jobs.queries";
|
||||||
import { selectBodyshop } from "../../redux/user/user.selectors";
|
import { selectBodyshop } from "../../redux/user/user.selectors";
|
||||||
import { DateTimeFormatter, TimeAgoFormatter } from "../../utils/DateFormatter";
|
import { DateTimeFormatter, TimeAgoFormatter } from "../../utils/DateFormatter";
|
||||||
|
import { onlyUnique } from "../../utils/arrayHelper";
|
||||||
|
import { pageLimit } from "../../utils/config";
|
||||||
import { alphaSort, dateSort } from "../../utils/sorters";
|
import { alphaSort, dateSort } from "../../utils/sorters";
|
||||||
import useLocalStorage from "../../utils/useLocalStorage";
|
import useLocalStorage from "../../utils/useLocalStorage";
|
||||||
import {pageLimit} from "../../utils/config";
|
import AlertComponent from "../alert/alert.component";
|
||||||
|
import JobPartsQueueCount from "../job-parts-queue-count/job-parts-queue-count.component";
|
||||||
|
import JobRemoveFromPartsQueue from "../job-remove-from-parst-queue/job-remove-from-parts-queue.component";
|
||||||
|
import OwnerNameDisplay, {
|
||||||
|
OwnerNameDisplayFunction,
|
||||||
|
} from "../owner-name-display/owner-name-display.component";
|
||||||
|
import ProductionListColumnComment from "../production-list-columns/production-list-columns.comment.component";
|
||||||
|
|
||||||
const mapStateToProps = createStructuredSelector({
|
const mapStateToProps = createStructuredSelector({
|
||||||
bodyshop: selectBodyshop,
|
bodyshop: selectBodyshop,
|
||||||
});
|
});
|
||||||
|
|
||||||
export function PartsQueuePageComponent({ bodyshop }) {
|
export function PartsQueueListComponent({ bodyshop }) {
|
||||||
const searchParams = queryString.parse(useLocation().search);
|
const searchParams = queryString.parse(useLocation().search);
|
||||||
const {
|
const { selected, sortcolumn, sortorder, statusFilters } = searchParams;
|
||||||
//page,
|
|
||||||
sortcolumn,
|
|
||||||
sortorder,
|
|
||||||
statusFilters,
|
|
||||||
} = searchParams;
|
|
||||||
const history = useHistory();
|
const history = useHistory();
|
||||||
const [filter, setFilter] = useLocalStorage("filter_parts_queue", null);
|
const [filter, setFilter] = useLocalStorage("filter_parts_queue", null);
|
||||||
|
|
||||||
@@ -39,19 +37,8 @@ export function PartsQueuePageComponent({ bodyshop }) {
|
|||||||
fetchPolicy: "network-only",
|
fetchPolicy: "network-only",
|
||||||
nextFetchPolicy: "network-only",
|
nextFetchPolicy: "network-only",
|
||||||
variables: {
|
variables: {
|
||||||
// offset: page ? (page - 1) * 25 : 0,
|
|
||||||
// limit: 25,
|
|
||||||
statuses: (statusFilters && JSON.parse(statusFilters)) ||
|
statuses: (statusFilters && JSON.parse(statusFilters)) ||
|
||||||
bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
|
bodyshop.md_ro_statuses.active_statuses || ["Open", "Open*"],
|
||||||
order: [
|
|
||||||
{
|
|
||||||
[sortcolumn || "ro_number"]: sortorder
|
|
||||||
? sortorder === "descend"
|
|
||||||
? "desc"
|
|
||||||
: "asc"
|
|
||||||
: "desc",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -107,6 +94,19 @@ export function PartsQueuePageComponent({ bodyshop }) {
|
|||||||
history.push({ search: queryString.stringify(searchParams) });
|
history.push({ search: queryString.stringify(searchParams) });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const handleOnRowClick = (record) => {
|
||||||
|
if (record) {
|
||||||
|
if (record.id) {
|
||||||
|
history.push({
|
||||||
|
search: queryString.stringify({
|
||||||
|
...searchParams,
|
||||||
|
selected: record.id,
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.ro_number"),
|
title: t("jobs.fields.ro_number"),
|
||||||
@@ -125,7 +125,8 @@ export function PartsQueuePageComponent({ bodyshop }) {
|
|||||||
title: t("jobs.fields.owner"),
|
title: t("jobs.fields.owner"),
|
||||||
dataIndex: "ownr_ln",
|
dataIndex: "ownr_ln",
|
||||||
key: "ownr_ln",
|
key: "ownr_ln",
|
||||||
sorter: (a, b) => alphaSort(a.ownr_ln, b.ownr_ln),
|
sorter: (a, b) =>
|
||||||
|
alphaSort(OwnerNameDisplayFunction(a), OwnerNameDisplayFunction(b)),
|
||||||
sortOrder: sortcolumn === "ownr_ln" && sortorder,
|
sortOrder: sortcolumn === "ownr_ln" && sortorder,
|
||||||
render: (text, record) => {
|
render: (text, record) => {
|
||||||
return record.ownerid ? (
|
return record.ownerid ? (
|
||||||
@@ -139,6 +140,56 @@ export function PartsQueuePageComponent({ bodyshop }) {
|
|||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.vehicle"),
|
||||||
|
dataIndex: "vehicle",
|
||||||
|
key: "vehicle",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) =>
|
||||||
|
alphaSort(
|
||||||
|
`${a.v_model_yr || ""} ${a.v_make_desc || ""} ${
|
||||||
|
a.v_model_desc || ""
|
||||||
|
}`,
|
||||||
|
`${b.v_model_yr || ""} ${b.v_make_desc || ""} ${b.v_model_desc || ""}`
|
||||||
|
),
|
||||||
|
sortOrder: sortcolumn === "vehicle" && sortorder,
|
||||||
|
render: (text, record) => {
|
||||||
|
return record.vehicleid ? (
|
||||||
|
<Link to={"/manage/vehicles/" + record.vehicleid}>
|
||||||
|
{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
||||||
|
record.v_model_desc || ""
|
||||||
|
}`}
|
||||||
|
</Link>
|
||||||
|
) : (
|
||||||
|
<span>{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
||||||
|
record.v_model_desc || ""
|
||||||
|
}`}</span>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: t("jobs.fields.ins_co_nm_short"),
|
||||||
|
dataIndex: "ins_co_nm",
|
||||||
|
key: "ins_co_nm",
|
||||||
|
ellipsis: true,
|
||||||
|
sorter: (a, b) => alphaSort(a.ins_co_nm, b.ins_co_nm),
|
||||||
|
sortOrder: sortcolumn === "ins_co_nm" && sortorder,
|
||||||
|
filteredValue: filter?.ins_co_nm || null,
|
||||||
|
filters:
|
||||||
|
(jobs &&
|
||||||
|
jobs
|
||||||
|
.map((j) => j.ins_co_nm)
|
||||||
|
.filter(onlyUnique)
|
||||||
|
.map((s) => {
|
||||||
|
return {
|
||||||
|
text: s || "No Ins. Co.*",
|
||||||
|
value: [s],
|
||||||
|
};
|
||||||
|
})
|
||||||
|
.sort((a, b) => alphaSort(a.text, b.text))) ||
|
||||||
|
[],
|
||||||
|
onFilter: (value, record) => value.includes(record.ins_co_nm),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.status"),
|
title: t("jobs.fields.status"),
|
||||||
dataIndex: "status",
|
dataIndex: "status",
|
||||||
@@ -170,23 +221,16 @@ export function PartsQueuePageComponent({ bodyshop }) {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: t("jobs.fields.vehicle"),
|
title: t("jobs.fields.scheduled_completion"),
|
||||||
dataIndex: "vehicle",
|
dataIndex: "scheduled_completion",
|
||||||
key: "vehicle",
|
key: "scheduled_completion",
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
render: (text, record) => {
|
sorter: (a, b) =>
|
||||||
return record.vehicleid ? (
|
dateSort(a.scheduled_completion, b.scheduled_completion),
|
||||||
<Link to={"/manage/vehicles/" + record.vehicleid}>
|
sortOrder: sortcolumn === "scheduled_completion" && sortorder,
|
||||||
{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
render: (text, record) => (
|
||||||
record.v_model_desc || ""
|
<DateTimeFormatter>{record.scheduled_completion}</DateTimeFormatter>
|
||||||
}`}
|
),
|
||||||
</Link>
|
|
||||||
) : (
|
|
||||||
<span>{`${record.v_model_yr || ""} ${record.v_make_desc || ""} ${
|
|
||||||
record.v_model_desc || ""
|
|
||||||
}`}</span>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
// title: t("vehicles.fields.plate_no"),
|
// title: t("vehicles.fields.plate_no"),
|
||||||
@@ -198,14 +242,6 @@ export function PartsQueuePageComponent({ bodyshop }) {
|
|||||||
// return record.plate_no ? record.plate_no : "";
|
// return record.plate_no ? record.plate_no : "";
|
||||||
// },
|
// },
|
||||||
// },
|
// },
|
||||||
{
|
|
||||||
title: t("jobs.fields.clm_no"),
|
|
||||||
dataIndex: "clm_no",
|
|
||||||
key: "clm_no",
|
|
||||||
ellipsis: true,
|
|
||||||
sorter: (a, b) => alphaSort(a.clm_no, b.clm_no),
|
|
||||||
sortOrder: sortcolumn === "clm_no" && sortorder,
|
|
||||||
},
|
|
||||||
// {
|
// {
|
||||||
// title: t("jobs.fields.clm_total"),
|
// title: t("jobs.fields.clm_total"),
|
||||||
// dataIndex: "clm_total",
|
// dataIndex: "clm_total",
|
||||||
@@ -307,9 +343,16 @@ export function PartsQueuePageComponent({ bodyshop }) {
|
|||||||
style={{ height: "100%" }}
|
style={{ height: "100%" }}
|
||||||
scroll={{ x: true }}
|
scroll={{ x: true }}
|
||||||
onChange={handleTableChange}
|
onChange={handleTableChange}
|
||||||
|
rowSelection={{
|
||||||
|
onSelect: (record) => {
|
||||||
|
handleOnRowClick(record);
|
||||||
|
},
|
||||||
|
selectedRowKeys: [selected],
|
||||||
|
type: "radio",
|
||||||
|
}}
|
||||||
/>
|
/>
|
||||||
</Card>
|
</Card>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default connect(mapStateToProps, null)(PartsQueuePageComponent);
|
export default connect(mapStateToProps, null)(PartsQueueListComponent);
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user