Compare commits
171 Commits
feature/pb
...
revert-pr-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f9a5e8485b | ||
|
|
0fdb663d50 | ||
|
|
d528a4b730 | ||
|
|
e4692c2965 | ||
|
|
a600bd446c | ||
|
|
9f28b80a5a | ||
|
|
77e865c5c4 | ||
|
|
d01a1aa0a0 | ||
|
|
77bfa90b59 | ||
|
|
b8d3c5e36c | ||
|
|
abac60a316 | ||
|
|
83626d83de | ||
|
|
928673691b | ||
|
|
818e0679d9 | ||
|
|
18f56a93d0 | ||
|
|
d4a6c528d0 | ||
|
|
6410f868db | ||
|
|
058cd31784 | ||
|
|
9a04c63f72 | ||
|
|
3fa38822f3 | ||
|
|
8d84ed8e00 | ||
|
|
60fa40f738 | ||
|
|
22d075c89a | ||
|
|
ac1eead695 | ||
|
|
5a12738da5 | ||
|
|
480cdb9b28 | ||
|
|
f389dfdd94 | ||
|
|
fb20cceebc | ||
|
|
b549f45cde | ||
|
|
a4fc26c139 | ||
|
|
8f9cecd6bf | ||
|
|
6c5d684218 | ||
|
|
ee05f59bd3 | ||
|
|
a62796b12f | ||
|
|
3a5508fc95 | ||
|
|
6a49457382 | ||
|
|
24d71413c1 | ||
|
|
00ae2cda5d | ||
|
|
3354afe380 | ||
|
|
089fc0b0f7 | ||
|
|
33dea8638c | ||
|
|
821bc850db | ||
|
|
3e8af5fec7 | ||
|
|
07dce11341 | ||
|
|
ab242955f1 | ||
|
|
2c1bd448e7 | ||
|
|
dc21c25c95 | ||
|
|
24c62f4905 | ||
|
|
f23868bbde | ||
|
|
7d84dcacee | ||
|
|
6aeeac15b6 | ||
|
|
e69a218392 | ||
|
|
477c7bb006 | ||
|
|
0f75ca555d | ||
|
|
e9c83e567a | ||
|
|
5ed8cef2f5 | ||
|
|
ff149c4464 | ||
|
|
195e4a05db | ||
|
|
7194d2bba0 | ||
|
|
9b92f83e52 | ||
|
|
88a9ec1d3c | ||
|
|
2e2e9ad7a9 | ||
|
|
eb52ccbc9d | ||
|
|
8f44b61a16 | ||
|
|
7104af82d7 | ||
|
|
511b7693c7 | ||
|
|
cdacc2befa | ||
|
|
93cdbea17c | ||
|
|
18c182e573 | ||
|
|
c2058bcec6 | ||
|
|
6031255d61 | ||
|
|
e9c229f307 | ||
|
|
26f6f63782 | ||
|
|
3eaf199322 | ||
|
|
9ded2fd5ba | ||
|
|
a1e35a137e | ||
|
|
fa9731369b | ||
|
|
616f326a88 | ||
|
|
60950be9d5 | ||
|
|
f479aeda54 | ||
|
|
98bf700d1c | ||
|
|
2a9609b917 | ||
|
|
423df9f9aa | ||
|
|
184ea58ec2 | ||
|
|
f9b6920eba | ||
|
|
9d8550e040 | ||
|
|
930321c885 | ||
|
|
5ff660d83d | ||
|
|
4b923acdf3 | ||
|
|
6337a961e9 | ||
|
|
fb04742e5b | ||
|
|
50f5be3174 | ||
|
|
63106487b9 | ||
|
|
a3a48c1b29 | ||
|
|
72d0a990ec | ||
|
|
e8d6871a20 | ||
|
|
5d4b2f308d | ||
|
|
84b274d0a5 | ||
|
|
271b2286ae | ||
|
|
660f851ee6 | ||
|
|
5367e96aad | ||
|
|
9ac262fec2 | ||
|
|
62e044fbb2 | ||
|
|
d71155f350 | ||
|
|
c105c56acf | ||
|
|
9c7f2a6080 | ||
|
|
bcd6cc006f | ||
|
|
b2e14ed03b | ||
|
|
1d21dc3ee4 | ||
|
|
3c355a8227 | ||
|
|
546208d249 | ||
|
|
012d59e5b7 | ||
|
|
8da2205a14 | ||
|
|
ad2bae00de | ||
|
|
8a21c24a5b | ||
|
|
4004856cd6 | ||
|
|
23ace9f7be | ||
|
|
64f188dbdc | ||
|
|
ce15216764 | ||
|
|
01253361b5 | ||
|
|
fad667f2a4 | ||
|
|
00b982becc | ||
|
|
c8fb685cb0 | ||
|
|
6a7b616037 | ||
|
|
6607258777 | ||
|
|
4ad9ccec47 | ||
|
|
896d82202b | ||
|
|
2ad4035294 | ||
|
|
e65101b4a9 | ||
|
|
cd25f079b5 | ||
|
|
427c2b762b | ||
|
|
f50b7ccaee | ||
|
|
c67bcd2098 | ||
|
|
6c6cce7da7 | ||
|
|
e273481a25 | ||
|
|
4b34cd2a2e | ||
|
|
f54883164c | ||
|
|
82e7e5d910 | ||
|
|
6831184e33 | ||
|
|
a39a79102d | ||
|
|
95fff2acc4 | ||
|
|
64d1c87dbd | ||
|
|
47dc00ff6e | ||
|
|
a2fbdd6a32 | ||
|
|
e46240f543 | ||
|
|
8882481006 | ||
|
|
79f66294d9 | ||
|
|
f9f1dbaf24 | ||
|
|
ac8ae34e1d | ||
|
|
e72925e34e | ||
|
|
9a6be8a71e | ||
|
|
11b20c54c2 | ||
|
|
ac7dcdd6a9 | ||
|
|
20abda83f3 | ||
|
|
826a57c012 | ||
|
|
1a0c5c44ba | ||
|
|
9e8eb35792 | ||
|
|
49618ac6ef | ||
|
|
ad8c13f346 | ||
|
|
e2f3d6ef83 | ||
|
|
a859990110 | ||
|
|
1286b72f2c | ||
|
|
5a42cafe8a | ||
|
|
1fd9bfc34c | ||
|
|
8e470376fd | ||
|
|
171e11c9f0 | ||
|
|
e56664bbc6 | ||
|
|
0f16f616d4 | ||
|
|
2fc2e0f02e | ||
|
|
3cd2445098 | ||
|
|
1742f66312 |
180
.circleci/config.yml
Normal file
180
.circleci/config.yml
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
version: 2.1
|
||||||
|
orbs:
|
||||||
|
#snyk: snyk/snyk@0.0.8
|
||||||
|
#cypress: cypress-io/cypress@1.23.0
|
||||||
|
aws-s3: circleci/aws-s3@2.0.0
|
||||||
|
eb: circleci/aws-elastic-beanstalk@1.0.2
|
||||||
|
jira: circleci/jira@1.3.1
|
||||||
|
jobs:
|
||||||
|
api-deploy:
|
||||||
|
docker:
|
||||||
|
- image: "cimg/base:stable"
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- eb/setup
|
||||||
|
- run:
|
||||||
|
command: |
|
||||||
|
eb init imex-online-production-api -r ca-central-1 -p "Node.js 16 running on 64bit Amazon Linux 2"
|
||||||
|
eb status --verbose
|
||||||
|
eb deploy
|
||||||
|
eb status
|
||||||
|
- jira/notify
|
||||||
|
|
||||||
|
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.imex.online/ --admin-secret << parameters.secret >>
|
||||||
|
hasura metadata apply --endpoint https://db.imex.online/ --admin-secret << parameters.secret >>
|
||||||
|
hasura metadata reload --endpoint https://db.imex.online/ --admin-secret << parameters.secret >>
|
||||||
|
|
||||||
|
app-build:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:16.15.0
|
||||||
|
|
||||||
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/repo
|
||||||
|
|
||||||
|
- restore_cache:
|
||||||
|
name: Restore Yarn Package Cache
|
||||||
|
keys:
|
||||||
|
- yarn-packages-{{ checksum "yarn.lock" }}
|
||||||
|
- run:
|
||||||
|
name: Install Dependencies
|
||||||
|
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
|
||||||
|
- save_cache:
|
||||||
|
name: Save Yarn Package Cache
|
||||||
|
key: yarn-packages-{{ checksum "yarn.lock" }}
|
||||||
|
paths:
|
||||||
|
- ~/.cache/yarn
|
||||||
|
|
||||||
|
- run: yarn run build
|
||||||
|
|
||||||
|
- aws-s3/sync:
|
||||||
|
from: build
|
||||||
|
to: "s3://imex-online-production/"
|
||||||
|
- jira/notify
|
||||||
|
|
||||||
|
test-hasura-migrate:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:16.15.0
|
||||||
|
parameters:
|
||||||
|
secret:
|
||||||
|
type: string
|
||||||
|
default: $HASURA_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.bodyshop.app/ --admin-secret << parameters.secret >>
|
||||||
|
hasura metadata apply --endpoint https://db.test.bodyshop.app/ --admin-secret << parameters.secret >>
|
||||||
|
hasura metadata reload --endpoint https://db.test.bodyshop.app/ --admin-secret << parameters.secret >>
|
||||||
|
|
||||||
|
test-app-build:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:16.15.0
|
||||||
|
|
||||||
|
working_directory: ~/repo/client
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/repo
|
||||||
|
|
||||||
|
- restore_cache:
|
||||||
|
name: Restore Yarn Package Cache
|
||||||
|
keys:
|
||||||
|
- yarn-packages-{{ checksum "yarn.lock" }}
|
||||||
|
- run:
|
||||||
|
name: Install Dependencies
|
||||||
|
command: yarn install --frozen-lockfile --cache-folder ~/.cache/yarn
|
||||||
|
- save_cache:
|
||||||
|
name: Save Yarn Package Cache
|
||||||
|
key: yarn-packages-{{ checksum "yarn.lock" }}
|
||||||
|
paths:
|
||||||
|
- ~/.cache/yarn
|
||||||
|
|
||||||
|
- run: yarn run build:test
|
||||||
|
|
||||||
|
- aws-s3/sync:
|
||||||
|
from: build
|
||||||
|
to: "s3://imex-online-test/"
|
||||||
|
- jira/notify
|
||||||
|
|
||||||
|
admin-app-build:
|
||||||
|
docker:
|
||||||
|
- image: cimg/node:16.15.0
|
||||||
|
|
||||||
|
working_directory: ~/repo/admin
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- checkout:
|
||||||
|
path: ~/repo
|
||||||
|
|
||||||
|
- restore_cache:
|
||||||
|
keys:
|
||||||
|
- v1-dependencies-{{ checksum "package.json" }}
|
||||||
|
# fallback to using the latest cache if no exact match is found
|
||||||
|
- v1-dependencies-
|
||||||
|
- run: npm i
|
||||||
|
|
||||||
|
- save_cache:
|
||||||
|
paths:
|
||||||
|
- node_modules
|
||||||
|
- ~/.npm
|
||||||
|
- ~/.cache
|
||||||
|
key: v1-dependencies-{{ checksum "package.json" }}
|
||||||
|
|
||||||
|
- run: npm run build
|
||||||
|
|
||||||
|
- aws-s3/sync:
|
||||||
|
from: build
|
||||||
|
to: "s3://adm.imex.online/"
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
deploy_and_build:
|
||||||
|
jobs:
|
||||||
|
- api-deploy:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: master
|
||||||
|
- app-build:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: master
|
||||||
|
- hasura-migrate:
|
||||||
|
secret: ${HASURA_PROD_SECRET}
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: master
|
||||||
|
- test-app-build:
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: test
|
||||||
|
- test-hasura-migrate:
|
||||||
|
secret: ${HASURA_TEST_SECRET}
|
||||||
|
filters:
|
||||||
|
branches:
|
||||||
|
only: test
|
||||||
|
#- admin-app-build:
|
||||||
|
#filters:
|
||||||
|
#branches:
|
||||||
|
#only: master
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
@@ -115,4 +115,6 @@ firebase/.env
|
|||||||
logs/oAuthClient-log.log
|
logs/oAuthClient-log.log
|
||||||
|
|
||||||
|
|
||||||
.node-persist/**
|
.node-persist/**
|
||||||
|
|
||||||
|
/*.env.*
|
||||||
@@ -4213,6 +4213,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>disablebillwip</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>disablecontactvehiclecreation</name>
|
<name>disablecontactvehiclecreation</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -14191,6 +14212,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>emailpreview</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>generatingemail</name>
|
<name>generatingemail</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -27535,6 +27577,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>disablebillwip</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>invoicedatefuture</name>
|
<name>invoicedatefuture</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
@@ -40392,6 +40455,27 @@
|
|||||||
</translation>
|
</translation>
|
||||||
</translations>
|
</translations>
|
||||||
</concept_node>
|
</concept_node>
|
||||||
|
<concept_node>
|
||||||
|
<name>cycle_time_analysis</name>
|
||||||
|
<definition_loaded>false</definition_loaded>
|
||||||
|
<description></description>
|
||||||
|
<comment></comment>
|
||||||
|
<default_text></default_text>
|
||||||
|
<translations>
|
||||||
|
<translation>
|
||||||
|
<language>en-US</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>es-MX</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
<translation>
|
||||||
|
<language>fr-CA</language>
|
||||||
|
<approved>false</approved>
|
||||||
|
</translation>
|
||||||
|
</translations>
|
||||||
|
</concept_node>
|
||||||
<concept_node>
|
<concept_node>
|
||||||
<name>estimates_written_converted</name>
|
<name>estimates_written_converted</name>
|
||||||
<definition_loaded>false</definition_loaded>
|
<definition_loaded>false</definition_loaded>
|
||||||
|
|||||||
13
client/.env.development
Normal file
13
client/.env.development
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
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_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_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/io-test
|
||||||
|
REACT_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/io-test
|
||||||
|
REACT_APP_CLOUDINARY_API_KEY=957865933348715
|
||||||
|
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
||||||
|
REACT_APP_FIREBASE_PUBLIC_VAPID_KEY='BG3tzU7L2BXlGZ_3VLK4PNaRceoEXEnmHfxcVbRMF5o5g05ejslhVPki9kBM9cBBT-08Ad9kN3HSpS6JmrWD6h4'
|
||||||
|
REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
||||||
|
REACT_APP_AXIOS_BASE_API_URL=https://api.imex.online/
|
||||||
|
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
||||||
|
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
||||||
13
client/.env.production
Normal file
13
client/.env.production
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
REACT_APP_GRAPHQL_ENDPOINT=https://db.imex.online/v1/graphql
|
||||||
|
REACT_APP_GRAPHQL_ENDPOINT_WS=wss://db.imex.online/v1/graphql
|
||||||
|
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_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/bodyshop
|
||||||
|
REACT_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/bodyshop
|
||||||
|
REACT_APP_CLOUDINARY_API_KEY=473322739956866
|
||||||
|
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
||||||
|
REACT_APP_FIREBASE_PUBLIC_VAPID_KEY='BMgZT1NZztW2DsJl8Mg2L04hgY9FzAg6b8fbzgNAfww2VDzH3VE63Ot9EaP_U7KWS2JT-7HPHaw0T_Tw_5vkZc8'
|
||||||
|
REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
||||||
|
REACT_APP_AXIOS_BASE_API_URL=https://api.imex.online/
|
||||||
|
REACT_APP_REPORTS_SERVER_URL=https://reports.imex.online
|
||||||
|
REACT_APP_SPLIT_API=et9pjkik6bn67he5evpmpr1agoo7gactphgk
|
||||||
14
client/.env.test
Normal file
14
client/.env.test
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
REACT_APP_GRAPHQL_ENDPOINT=https://db.test.bodyshop.app/v1/graphql
|
||||||
|
REACT_APP_GRAPHQL_ENDPOINT_WS=wss://db.test.bodyshop.app/v1/graphql
|
||||||
|
REACT_APP_GA_CODE=231099835
|
||||||
|
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_CLOUDINARY_ENDPOINT_API=https://api.cloudinary.com/v1_1/bodyshop
|
||||||
|
REACT_APP_CLOUDINARY_ENDPOINT=https://res.cloudinary.com/bodyshop
|
||||||
|
REACT_APP_CLOUDINARY_API_KEY=473322739956866
|
||||||
|
REACT_APP_CLOUDINARY_THUMB_TRANSFORMATIONS=c_fill,h_250,w_250
|
||||||
|
REACT_APP_FIREBASE_PUBLIC_VAPID_KEY='BN2GcDPjipR5MTEosO5dT4CfQ3cmrdBIsI4juoOQrRijn_5aRiHlwj1mlq0W145mOusx6xynEKl_tvYJhpCc9lo'
|
||||||
|
REACT_APP_STRIPE_PUBLIC_KEY=pk_test_51GqB4TJl3nQjrZ0wCQWAxAhlNF8jKe0tipIa6ExBaxwJGitwvFsIZUEua4dUzaMIAuXp4qwYHXx7lgjyQSwP0Pe900vzm38C7g
|
||||||
|
REACT_APP_AXIOS_BASE_API_URL=https://api.test.imex.online/
|
||||||
|
REACT_APP_REPORTS_SERVER_URL=https://reports3.test.imex.online
|
||||||
|
REACT_APP_IS_TEST=true
|
||||||
|
REACT_APP_SPLIT_API=ts615lqgnmk84thn72uk18uu5pgce6e0l4rc
|
||||||
@@ -39,7 +39,13 @@ export function ContractsFindModalContainer({
|
|||||||
if (!claim || !shortclaim) return;
|
if (!claim || !shortclaim) return;
|
||||||
const trimmedShortClaim = shortclaim.trim();
|
const trimmedShortClaim = shortclaim.trim();
|
||||||
// const trimmedClaim = claim.trim();
|
// const trimmedClaim = claim.trim();
|
||||||
claimNumbers.push({ claim: trimmedShortClaim, amount });
|
if (amount.slice(-1) === "-") {
|
||||||
|
}
|
||||||
|
|
||||||
|
claimNumbers.push({
|
||||||
|
claim: trimmedShortClaim,
|
||||||
|
amount: amount.slice(-1) === "-" ? parseFloat(amount) * -1 : amount,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
await GenerateDocument(
|
await GenerateDocument(
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
import { SyncOutlined } from "@ant-design/icons";
|
import { SyncOutlined } from "@ant-design/icons";
|
||||||
import { Button, Card, Form, Input, Table } from "antd";
|
import { Button, Card, Form, Input, Table } from "antd";
|
||||||
import Dinero from "dinero.js";
|
|
||||||
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";
|
||||||
@@ -141,7 +140,10 @@ export function DmsAllocationsSummaryAp({ socket, bodyshop, billids, title }) {
|
|||||||
>
|
>
|
||||||
<Input />
|
<Input />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Button disabled={!socket.allocationsSummary} htmlType="submit">
|
<Button
|
||||||
|
disabled={!allocationsSummary || allocationsSummary.length === 0}
|
||||||
|
htmlType="submit"
|
||||||
|
>
|
||||||
{t("jobs.actions.dms.post")}
|
{t("jobs.actions.dms.post")}
|
||||||
</Button>
|
</Button>
|
||||||
</Form>
|
</Form>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Button, Card, Table, Typography } from "antd";
|
import { Alert, Button, Card, Table, Typography } from "antd";
|
||||||
import React, { useState, useEffect } from "react";
|
import React, { useState, useEffect } from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
import { connect } from "react-redux";
|
import { connect } from "react-redux";
|
||||||
@@ -90,6 +90,9 @@ export function DmsAllocationsSummary({ socket, bodyshop, jobId, title }) {
|
|||||||
</Button>
|
</Button>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
|
{bodyshop.pbs_configuration?.disablebillwip && (
|
||||||
|
<Alert type="warning" message={t("jobs.labels.dms.disablebillwip")} />
|
||||||
|
)}
|
||||||
<Table
|
<Table
|
||||||
pagination={{ position: "top", defaultPageSize: 50 }}
|
pagination={{ position: "top", defaultPageSize: 50 }}
|
||||||
columns={columns}
|
columns={columns}
|
||||||
|
|||||||
@@ -178,6 +178,7 @@ export function EmailOverlayContainer({
|
|||||||
maskClosable={false}
|
maskClosable={false}
|
||||||
width={"80%"}
|
width={"80%"}
|
||||||
onOk={() => form.submit()}
|
onOk={() => form.submit()}
|
||||||
|
title={t("emails.labels.emailpreview")}
|
||||||
onCancel={() => {
|
onCancel={() => {
|
||||||
toggleEmailOverlayVisible();
|
toggleEmailOverlayVisible();
|
||||||
}}
|
}}
|
||||||
@@ -198,7 +199,7 @@ export function EmailOverlayContainer({
|
|||||||
<div>
|
<div>
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
marginTop: "1rem",
|
// marginTop: "3rem",
|
||||||
display: "flex",
|
display: "flex",
|
||||||
justifyContent: "flex-end",
|
justifyContent: "flex-end",
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import Icon, {
|
|||||||
FileAddFilled,
|
FileAddFilled,
|
||||||
FileAddOutlined,
|
FileAddOutlined,
|
||||||
FileFilled,
|
FileFilled,
|
||||||
GlobalOutlined,
|
//GlobalOutlined,
|
||||||
HomeFilled,
|
HomeFilled,
|
||||||
ImportOutlined,
|
ImportOutlined,
|
||||||
LineChartOutlined,
|
LineChartOutlined,
|
||||||
@@ -374,25 +374,27 @@ function Header({
|
|||||||
<Menu.Item key="profile">
|
<Menu.Item key="profile">
|
||||||
<Link to="/manage/profile">{t("menus.currentuser.profile")}</Link>
|
<Link to="/manage/profile">{t("menus.currentuser.profile")}</Link>
|
||||||
</Menu.Item>
|
</Menu.Item>
|
||||||
<Menu.SubMenu
|
{
|
||||||
key="langselecter"
|
// <Menu.SubMenu
|
||||||
title={
|
// key="langselecter"
|
||||||
<span>
|
// title={
|
||||||
<GlobalOutlined />
|
// <span>
|
||||||
<span>{t("menus.currentuser.languageselector")}</span>
|
// <GlobalOutlined />
|
||||||
</span>
|
// <span>{t("menus.currentuser.languageselector")}</span>
|
||||||
}
|
// </span>
|
||||||
>
|
// }
|
||||||
<Menu.Item actiontype="lang-select" key="en-US">
|
// >
|
||||||
{t("general.languages.english")}
|
// <Menu.Item actiontype="lang-select" key="en-US">
|
||||||
</Menu.Item>
|
// {t("general.languages.english")}
|
||||||
<Menu.Item actiontype="lang-select" key="fr-CA">
|
// </Menu.Item>
|
||||||
{t("general.languages.french")}
|
// <Menu.Item actiontype="lang-select" key="fr-CA">
|
||||||
</Menu.Item>
|
// {t("general.languages.french")}
|
||||||
<Menu.Item actiontype="lang-select" key="es-MX">
|
// </Menu.Item>
|
||||||
{t("general.languages.spanish")}
|
// <Menu.Item actiontype="lang-select" key="es-MX">
|
||||||
</Menu.Item>
|
// {t("general.languages.spanish")}
|
||||||
</Menu.SubMenu>
|
// </Menu.Item>
|
||||||
|
// </Menu.SubMenu>
|
||||||
|
}
|
||||||
</Menu.SubMenu>
|
</Menu.SubMenu>
|
||||||
<Menu.SubMenu key="recent" title={<ClockCircleFilled />}>
|
<Menu.SubMenu key="recent" title={<ClockCircleFilled />}>
|
||||||
{recentItems.map((i, idx) => (
|
{recentItems.map((i, idx) => (
|
||||||
|
|||||||
@@ -148,6 +148,15 @@ export function ShopInfoResponsibilityCenterComponent({ bodyshop, form }) {
|
|||||||
<Switch />
|
<Switch />
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
)}
|
)}
|
||||||
|
{bodyshop.pbs_serialnumber && (
|
||||||
|
<Form.Item
|
||||||
|
label={t("bodyshop.fields.dms.disablebillwip")}
|
||||||
|
valuePropName="checked"
|
||||||
|
name={["pbs_configuration", "disablebillwip"]}
|
||||||
|
>
|
||||||
|
<Switch />
|
||||||
|
</Form.Item>
|
||||||
|
)}
|
||||||
</LayoutFormRow>
|
</LayoutFormRow>
|
||||||
<LayoutFormRow header={t("bodyshop.labels.dms.cdk.payers")}>
|
<LayoutFormRow header={t("bodyshop.labels.dms.cdk.payers")}>
|
||||||
<Form.List name={["cdk_configuration", "payers"]}>
|
<Form.List name={["cdk_configuration", "payers"]}>
|
||||||
|
|||||||
@@ -855,7 +855,7 @@ export const QUERY_JOB_CARD_DETAILS = gql`
|
|||||||
count
|
count
|
||||||
status
|
status
|
||||||
}
|
}
|
||||||
joblines {
|
joblines(where: { removed: { _eq: false } }) {
|
||||||
id
|
id
|
||||||
mod_lbr_ty
|
mod_lbr_ty
|
||||||
mod_lb_hrs
|
mod_lb_hrs
|
||||||
|
|||||||
@@ -264,6 +264,7 @@
|
|||||||
"dms": {
|
"dms": {
|
||||||
"cashierid": "Cashier ID",
|
"cashierid": "Cashier ID",
|
||||||
"default_journal": "Default Journal",
|
"default_journal": "Default Journal",
|
||||||
|
"disablebillwip": "Disable bill WIP for A/P Posting",
|
||||||
"disablecontactvehiclecreation": "Disable Contact & Vehicle Updates/Creation",
|
"disablecontactvehiclecreation": "Disable Contact & Vehicle Updates/Creation",
|
||||||
"dms_acctnumber": "DMS Account #",
|
"dms_acctnumber": "DMS Account #",
|
||||||
"dms_wip_acctnumber": "DMS W.I.P. Account #",
|
"dms_wip_acctnumber": "DMS W.I.P. Account #",
|
||||||
@@ -881,6 +882,7 @@
|
|||||||
"labels": {
|
"labels": {
|
||||||
"attachments": "Attachments",
|
"attachments": "Attachments",
|
||||||
"documents": "Documents",
|
"documents": "Documents",
|
||||||
|
"emailpreview": "Email Preview",
|
||||||
"generatingemail": "Generating email...",
|
"generatingemail": "Generating email...",
|
||||||
"pdfcopywillbeattached": "A PDF copy of this email will be attached when it is sent.",
|
"pdfcopywillbeattached": "A PDF copy of this email will be attached when it is sent.",
|
||||||
"preview": "Email Preview"
|
"preview": "Email Preview"
|
||||||
@@ -1623,6 +1625,7 @@
|
|||||||
"apexported": "AP export completed. See logs for details.",
|
"apexported": "AP export completed. See logs for details.",
|
||||||
"damageto": "Damage to $t(jobs.fields.area_of_damage_impact.{{area_of_damage}}).",
|
"damageto": "Damage to $t(jobs.fields.area_of_damage_impact.{{area_of_damage}}).",
|
||||||
"defaultstory": "B/S RO: {{ro_number}}. Owner: {{ownr_nm}}. Insurance Co: {{ins_co_nm}}. Claim/PO #: {{clm_po}}",
|
"defaultstory": "B/S RO: {{ro_number}}. Owner: {{ownr_nm}}. Insurance Co: {{ins_co_nm}}. Claim/PO #: {{clm_po}}",
|
||||||
|
"disablebillwip": "Cost and WIP for bills has been ignored per shop configuration.",
|
||||||
"invoicedatefuture": "Invoice date must be today or in the future for CDK posting.",
|
"invoicedatefuture": "Invoice date must be today or in the future for CDK posting.",
|
||||||
"kmoutnotgreaterthankmin": "Mileage out must be greater than mileage in.",
|
"kmoutnotgreaterthankmin": "Mileage out must be greater than mileage in.",
|
||||||
"logs": "Logs",
|
"logs": "Logs",
|
||||||
@@ -2096,7 +2099,7 @@
|
|||||||
},
|
},
|
||||||
"labels": {
|
"labels": {
|
||||||
"balance": "Balance",
|
"balance": "Balance",
|
||||||
"ca_bc_etf_table": "ICBC ETF Table Converter",
|
"ca_bc_etf_table": "ICBC EFT Table Converter",
|
||||||
"customer": "Customer",
|
"customer": "Customer",
|
||||||
"edit": "Edit Payment",
|
"edit": "Edit Payment",
|
||||||
"electronicpayment": "Use Electronic Payment Processing?",
|
"electronicpayment": "Use Electronic Payment Processing?",
|
||||||
@@ -2272,7 +2275,7 @@
|
|||||||
"title": "Print Center"
|
"title": "Print Center"
|
||||||
},
|
},
|
||||||
"payments": {
|
"payments": {
|
||||||
"ca_bc_etf_table": "ICBC ETF Table",
|
"ca_bc_etf_table": "ICBC EFT Table",
|
||||||
"exported_payroll": "Payroll Table"
|
"exported_payroll": "Payroll Table"
|
||||||
},
|
},
|
||||||
"special": {
|
"special": {
|
||||||
@@ -2400,6 +2403,7 @@
|
|||||||
"credits_not_received_date": "Credits not Received by Date",
|
"credits_not_received_date": "Credits not Received by Date",
|
||||||
"credits_not_received_date_vendorid": "Credits not Received by Vendor",
|
"credits_not_received_date_vendorid": "Credits not Received by Vendor",
|
||||||
"csi": "CSI Responses",
|
"csi": "CSI Responses",
|
||||||
|
"cycle_time_analysis": "Cycle Time Analysis",
|
||||||
"estimates_written_converted": "Estimates Written/Converted",
|
"estimates_written_converted": "Estimates Written/Converted",
|
||||||
"estimator_detail": "Jobs by Estimator (Detail)",
|
"estimator_detail": "Jobs by Estimator (Detail)",
|
||||||
"estimator_summary": "Jobs by Estimator (Summary)",
|
"estimator_summary": "Jobs by Estimator (Summary)",
|
||||||
|
|||||||
@@ -264,6 +264,7 @@
|
|||||||
"dms": {
|
"dms": {
|
||||||
"cashierid": "",
|
"cashierid": "",
|
||||||
"default_journal": "",
|
"default_journal": "",
|
||||||
|
"disablebillwip": "",
|
||||||
"disablecontactvehiclecreation": "",
|
"disablecontactvehiclecreation": "",
|
||||||
"dms_acctnumber": "",
|
"dms_acctnumber": "",
|
||||||
"dms_wip_acctnumber": "",
|
"dms_wip_acctnumber": "",
|
||||||
@@ -881,6 +882,7 @@
|
|||||||
"labels": {
|
"labels": {
|
||||||
"attachments": "",
|
"attachments": "",
|
||||||
"documents": "",
|
"documents": "",
|
||||||
|
"emailpreview": "",
|
||||||
"generatingemail": "",
|
"generatingemail": "",
|
||||||
"pdfcopywillbeattached": "",
|
"pdfcopywillbeattached": "",
|
||||||
"preview": ""
|
"preview": ""
|
||||||
@@ -1623,6 +1625,7 @@
|
|||||||
"apexported": "",
|
"apexported": "",
|
||||||
"damageto": "",
|
"damageto": "",
|
||||||
"defaultstory": "",
|
"defaultstory": "",
|
||||||
|
"disablebillwip": "",
|
||||||
"invoicedatefuture": "",
|
"invoicedatefuture": "",
|
||||||
"kmoutnotgreaterthankmin": "",
|
"kmoutnotgreaterthankmin": "",
|
||||||
"logs": "",
|
"logs": "",
|
||||||
@@ -2400,6 +2403,7 @@
|
|||||||
"credits_not_received_date": "",
|
"credits_not_received_date": "",
|
||||||
"credits_not_received_date_vendorid": "",
|
"credits_not_received_date_vendorid": "",
|
||||||
"csi": "",
|
"csi": "",
|
||||||
|
"cycle_time_analysis": "",
|
||||||
"estimates_written_converted": "",
|
"estimates_written_converted": "",
|
||||||
"estimator_detail": "",
|
"estimator_detail": "",
|
||||||
"estimator_summary": "",
|
"estimator_summary": "",
|
||||||
|
|||||||
@@ -264,6 +264,7 @@
|
|||||||
"dms": {
|
"dms": {
|
||||||
"cashierid": "",
|
"cashierid": "",
|
||||||
"default_journal": "",
|
"default_journal": "",
|
||||||
|
"disablebillwip": "",
|
||||||
"disablecontactvehiclecreation": "",
|
"disablecontactvehiclecreation": "",
|
||||||
"dms_acctnumber": "",
|
"dms_acctnumber": "",
|
||||||
"dms_wip_acctnumber": "",
|
"dms_wip_acctnumber": "",
|
||||||
@@ -881,6 +882,7 @@
|
|||||||
"labels": {
|
"labels": {
|
||||||
"attachments": "",
|
"attachments": "",
|
||||||
"documents": "",
|
"documents": "",
|
||||||
|
"emailpreview": "",
|
||||||
"generatingemail": "",
|
"generatingemail": "",
|
||||||
"pdfcopywillbeattached": "",
|
"pdfcopywillbeattached": "",
|
||||||
"preview": ""
|
"preview": ""
|
||||||
@@ -1623,6 +1625,7 @@
|
|||||||
"apexported": "",
|
"apexported": "",
|
||||||
"damageto": "",
|
"damageto": "",
|
||||||
"defaultstory": "",
|
"defaultstory": "",
|
||||||
|
"disablebillwip": "",
|
||||||
"invoicedatefuture": "",
|
"invoicedatefuture": "",
|
||||||
"kmoutnotgreaterthankmin": "",
|
"kmoutnotgreaterthankmin": "",
|
||||||
"logs": "",
|
"logs": "",
|
||||||
@@ -2400,6 +2403,7 @@
|
|||||||
"credits_not_received_date": "",
|
"credits_not_received_date": "",
|
||||||
"credits_not_received_date_vendorid": "",
|
"credits_not_received_date_vendorid": "",
|
||||||
"csi": "",
|
"csi": "",
|
||||||
|
"cycle_time_analysis": "",
|
||||||
"estimates_written_converted": "",
|
"estimates_written_converted": "",
|
||||||
"estimator_detail": "",
|
"estimator_detail": "",
|
||||||
"estimator_summary": "",
|
"estimator_summary": "",
|
||||||
|
|||||||
@@ -22,5 +22,6 @@ const range = {
|
|||||||
moment().startOf("quarter"),
|
moment().startOf("quarter"),
|
||||||
moment().startOf("quarter").add(1, "quarter").subtract(1, "day"),
|
moment().startOf("quarter").add(1, "quarter").subtract(1, "day"),
|
||||||
],
|
],
|
||||||
|
"Last 90 Days": [moment().add(-90, "days"), moment()],
|
||||||
};
|
};
|
||||||
export default range;
|
export default range;
|
||||||
|
|||||||
@@ -1682,6 +1682,18 @@ export const TemplateList = (type, context) => {
|
|||||||
},
|
},
|
||||||
group: "sales",
|
group: "sales",
|
||||||
},
|
},
|
||||||
|
cycle_time_analysis: {
|
||||||
|
title: i18n.t("reportcenter.templates.cycle_time_analysis"),
|
||||||
|
subject: i18n.t("reportcenter.templates.cycle_time_analysis"),
|
||||||
|
key: "cycle_time_analysis",
|
||||||
|
//idtype: "vendor",
|
||||||
|
disabled: false,
|
||||||
|
rangeFilter: {
|
||||||
|
object: i18n.t("reportcenter.labels.objects.jobs"),
|
||||||
|
field: i18n.t("jobs.fields.actual_completion"),
|
||||||
|
},
|
||||||
|
group: "jobs",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
: {}),
|
: {}),
|
||||||
...(!type || type === "courtesycarcontract"
|
...(!type || type === "courtesycarcontract"
|
||||||
|
|||||||
@@ -3769,6 +3769,27 @@
|
|||||||
- active:
|
- active:
|
||||||
_eq: true
|
_eq: true
|
||||||
event_triggers:
|
event_triggers:
|
||||||
|
- name: job_status_transition
|
||||||
|
definition:
|
||||||
|
enable_manual: false
|
||||||
|
insert:
|
||||||
|
columns: '*'
|
||||||
|
update:
|
||||||
|
columns:
|
||||||
|
- status
|
||||||
|
retry_conf:
|
||||||
|
interval_sec: 10
|
||||||
|
num_retries: 0
|
||||||
|
timeout_sec: 60
|
||||||
|
webhook_from_env: HASURA_API_URL
|
||||||
|
headers:
|
||||||
|
- name: event-secret
|
||||||
|
value_from_env: EVENT_SECRET
|
||||||
|
request_transform:
|
||||||
|
query_params: {}
|
||||||
|
template_engine: Kriti
|
||||||
|
url: '{{$base_url}}/job/statustransition'
|
||||||
|
version: 2
|
||||||
- name: jobs_arms
|
- name: jobs_arms
|
||||||
definition:
|
definition:
|
||||||
enable_manual: false
|
enable_manual: false
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ var job = require("./server/job/job");
|
|||||||
app.post("/job/totals", fb.validateFirebaseIdToken, job.totals);
|
app.post("/job/totals", fb.validateFirebaseIdToken, job.totals);
|
||||||
app.post(
|
app.post(
|
||||||
"/job/statustransition",
|
"/job/statustransition",
|
||||||
fb.validateFirebaseIdToken,
|
// fb.validateFirebaseIdToken,
|
||||||
job.statustransition
|
job.statustransition
|
||||||
);
|
);
|
||||||
app.post("/job/totalsssu", fb.validateFirebaseIdToken, job.totalsSsu);
|
app.post("/job/totalsssu", fb.validateFirebaseIdToken, job.totalsSsu);
|
||||||
|
|||||||
@@ -118,26 +118,34 @@ exports.default = async function (socket, jobid) {
|
|||||||
} for cost export.`
|
} for cost export.`
|
||||||
);
|
);
|
||||||
|
|
||||||
const costCenterHash = job.bills.reduce((bill_acc, bill_val) => {
|
let costCenterHash = {};
|
||||||
bill_val.billlines.map((line_val) => {
|
//Check whether to skip this if PBS and using AP module.
|
||||||
if (!bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]])
|
const disablebillwip = !!bodyshop?.pbs_configuration?.disablebillwip;
|
||||||
|
|
||||||
|
if (!disablebillwip) {
|
||||||
|
costCenterHash = job.bills.reduce((bill_acc, bill_val) => {
|
||||||
|
bill_val.billlines.map((line_val) => {
|
||||||
|
if (
|
||||||
|
!bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]]
|
||||||
|
)
|
||||||
|
bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] =
|
||||||
|
Dinero();
|
||||||
|
|
||||||
|
let lineDinero = Dinero({
|
||||||
|
amount: Math.round((line_val.actual_cost || 0) * 100),
|
||||||
|
})
|
||||||
|
.multiply(line_val.quantity)
|
||||||
|
.multiply(bill_val.is_credit_memo ? -1 : 1);
|
||||||
|
|
||||||
bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] =
|
bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] =
|
||||||
Dinero();
|
bill_acc[
|
||||||
|
selectedDmsAllocationConfig.costs[line_val.cost_center]
|
||||||
let lineDinero = Dinero({
|
].add(lineDinero);
|
||||||
amount: Math.round((line_val.actual_cost || 0) * 100),
|
return null;
|
||||||
})
|
});
|
||||||
.multiply(line_val.quantity)
|
return bill_acc;
|
||||||
.multiply(bill_val.is_credit_memo ? -1 : 1);
|
}, {});
|
||||||
|
}
|
||||||
bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]] =
|
|
||||||
bill_acc[selectedDmsAllocationConfig.costs[line_val.cost_center]].add(
|
|
||||||
lineDinero
|
|
||||||
);
|
|
||||||
return null;
|
|
||||||
});
|
|
||||||
return bill_acc;
|
|
||||||
}, {});
|
|
||||||
|
|
||||||
job.timetickets.forEach((ticket) => {
|
job.timetickets.forEach((ticket) => {
|
||||||
//Get the total amount of the ticket.
|
//Get the total amount of the ticket.
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ exports.default = async (req, res) => {
|
|||||||
CompanyName:
|
CompanyName:
|
||||||
process.env.NODE_ENV === "production"
|
process.env.NODE_ENV === "production"
|
||||||
? bodyshop.shopname
|
? bodyshop.shopname
|
||||||
: "IMEX Test Shop",
|
: "IMEX Test Canadian Shop",
|
||||||
IDInfo: {
|
IDInfo: {
|
||||||
IDQualifierCode: "US",
|
IDQualifierCode: "US",
|
||||||
IDNum: bodyshop.entegral_id,
|
IDNum: bodyshop.entegral_id,
|
||||||
|
|||||||
@@ -1351,6 +1351,7 @@ exports.GET_CDK_ALLOCATIONS = `query QUERY_JOB_CLOSE_DETAILS($id: uuid!) {
|
|||||||
id
|
id
|
||||||
md_responsibility_centers
|
md_responsibility_centers
|
||||||
cdk_configuration
|
cdk_configuration
|
||||||
|
pbs_configuration
|
||||||
}
|
}
|
||||||
ro_number
|
ro_number
|
||||||
dms_allocation
|
dms_allocation
|
||||||
|
|||||||
@@ -7,22 +7,29 @@ const logger = require("../utils/logger");
|
|||||||
// Dinero.defaultCurrency = "USD";
|
// Dinero.defaultCurrency = "USD";
|
||||||
// Dinero.globalLocale = "en-CA";
|
// Dinero.globalLocale = "en-CA";
|
||||||
Dinero.globalRoundingMode = "HALF_EVEN";
|
Dinero.globalRoundingMode = "HALF_EVEN";
|
||||||
|
const path = require("path");
|
||||||
|
const client = require("../graphql-client/graphql-client").client;
|
||||||
|
require("dotenv").config({
|
||||||
|
path: path.resolve(
|
||||||
|
process.cwd(),
|
||||||
|
`.env.${process.env.NODE_ENV || "development"}`
|
||||||
|
),
|
||||||
|
});
|
||||||
async function StatusTransition(req, res) {
|
async function StatusTransition(req, res) {
|
||||||
const { jobid, value, bodyshopid } = req.body;
|
if (req.headers["event-secret"] !== process.env.EVENT_SECRET) {
|
||||||
|
res.status(403).send("Unauthorized");
|
||||||
const BearerToken = req.headers.authorization;
|
return;
|
||||||
logger.log("job-costing-start", "DEBUG", req.user.email, jobid, null);
|
}
|
||||||
const client = new GraphQLClient(process.env.GRAPHQL_ENDPOINT, {
|
|
||||||
headers: {
|
|
||||||
Authorization: BearerToken,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
|
const {
|
||||||
|
id: jobid,
|
||||||
|
status: value,
|
||||||
|
shopid: bodyshopid,
|
||||||
|
} = req.body.event.data.new;
|
||||||
try {
|
try {
|
||||||
const { update_transitions } = await client
|
const { update_transitions } = await client.request(
|
||||||
.setHeaders({ Authorization: BearerToken })
|
queries.UPDATE_OLD_TRANSITION,
|
||||||
.request(queries.UPDATE_OLD_TRANSITION, {
|
{
|
||||||
jobid: jobid,
|
jobid: jobid,
|
||||||
existingTransition: {
|
existingTransition: {
|
||||||
end: new Date(),
|
end: new Date(),
|
||||||
@@ -30,7 +37,8 @@ async function StatusTransition(req, res) {
|
|||||||
|
|
||||||
//duration
|
//duration
|
||||||
},
|
},
|
||||||
});
|
}
|
||||||
|
);
|
||||||
|
|
||||||
let duration =
|
let duration =
|
||||||
update_transitions.affected_rows === 0
|
update_transitions.affected_rows === 0
|
||||||
@@ -38,29 +46,27 @@ async function StatusTransition(req, res) {
|
|||||||
: new Date(update_transitions.returning[0].end) -
|
: new Date(update_transitions.returning[0].end) -
|
||||||
new Date(update_transitions.returning[0].start);
|
new Date(update_transitions.returning[0].start);
|
||||||
|
|
||||||
const resp2 = await client
|
const resp2 = await client.request(queries.INSERT_NEW_TRANSITION, {
|
||||||
.setHeaders({ Authorization: BearerToken })
|
oldTransitionId:
|
||||||
.request(queries.INSERT_NEW_TRANSITION, {
|
update_transitions.affected_rows === 0
|
||||||
oldTransitionId:
|
? null
|
||||||
|
: update_transitions.returning[0].id,
|
||||||
|
duration,
|
||||||
|
newTransition: {
|
||||||
|
bodyshopid: bodyshopid,
|
||||||
|
jobid: jobid,
|
||||||
|
start:
|
||||||
|
update_transitions.affected_rows === 0
|
||||||
|
? new Date()
|
||||||
|
: update_transitions.returning[0].end,
|
||||||
|
prev_value:
|
||||||
update_transitions.affected_rows === 0
|
update_transitions.affected_rows === 0
|
||||||
? null
|
? null
|
||||||
: update_transitions.returning[0].id,
|
: update_transitions.returning[0].value,
|
||||||
duration,
|
value: value,
|
||||||
newTransition: {
|
type: "status",
|
||||||
bodyshopid: bodyshopid,
|
},
|
||||||
jobid: jobid,
|
});
|
||||||
start:
|
|
||||||
update_transitions.affected_rows === 0
|
|
||||||
? new Date()
|
|
||||||
: update_transitions.returning[0].end,
|
|
||||||
prev_value:
|
|
||||||
update_transitions.affected_rows === 0
|
|
||||||
? null
|
|
||||||
: update_transitions.returning[0].value,
|
|
||||||
value: value,
|
|
||||||
type: "status",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
//Check to see if there is an existing status transition record.
|
//Check to see if there is an existing status transition record.
|
||||||
//Query using Job ID, start is not null, end is null.
|
//Query using Job ID, start is not null, end is null.
|
||||||
|
|||||||
Reference in New Issue
Block a user