Compare commits
20 Commits
feature/IO
...
feature/co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b22480bd02 | ||
|
|
15792cb0ef | ||
|
|
856a24d496 | ||
|
|
74d6bcc004 | ||
|
|
01664c52ec | ||
|
|
e66d52784f | ||
|
|
a75969097e | ||
|
|
a384fd5072 | ||
|
|
490c66a9cb | ||
|
|
d38dab0738 | ||
|
|
37624d385f | ||
|
|
d565934288 | ||
|
|
5d03574d65 | ||
|
|
34f7c115b4 | ||
|
|
3ac74df504 | ||
|
|
d5f13f750f | ||
|
|
b9ddac36a9 | ||
|
|
c982dde1f5 | ||
|
|
7f61f652f7 | ||
|
|
282a22ff51 |
@@ -1,5 +1,9 @@
|
|||||||
root = true
|
root = true
|
||||||
|
|
||||||
|
# NOTE: Keep only EditorConfig properties that Prettier actually respects.
|
||||||
|
# Style choices (quotes, bracket spacing, print width, etc.) live in `.prettierrc.js`.
|
||||||
|
# Removing pseudo/unsupported keys (quote_type, bracketSpacing, max_line_length) that
|
||||||
|
# previously caused editor vs CLI confusion.
|
||||||
[*]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
indent_style = space
|
indent_style = space
|
||||||
@@ -7,14 +11,11 @@ indent_size = 2
|
|||||||
end_of_line = lf
|
end_of_line = lf
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
quote_type = single
|
|
||||||
max_line_length = 100
|
|
||||||
bracketSpacing = false
|
|
||||||
|
|
||||||
[*.md]
|
[*.md]
|
||||||
trim_trailing_whitespace = false
|
trim_trailing_whitespace = false
|
||||||
|
|
||||||
[*.yml]
|
[*\.yml]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
[*.json]
|
[*.json]
|
||||||
|
|||||||
11
.prettierignore
Normal file
11
.prettierignore
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# Folders & files to skip during formatting
|
||||||
|
node_modules
|
||||||
|
build
|
||||||
|
dist
|
||||||
|
dev-dist
|
||||||
|
coverage
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
# Generated / compiled assets
|
||||||
|
client/dev-dist
|
||||||
|
client/dist
|
||||||
10
.vscode/settings.json
vendored
10
.vscode/settings.json
vendored
@@ -39,5 +39,13 @@
|
|||||||
"timetickets",
|
"timetickets",
|
||||||
"touchtime"
|
"touchtime"
|
||||||
],
|
],
|
||||||
"eslint.workingDirectories": ["./", "./client"]
|
"eslint.workingDirectories": ["./", "./client"],
|
||||||
|
// Formatting alignment: ensure VS Code uses project Prettier config
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
|
"editor.formatOnSave": true,
|
||||||
|
"[javascript]": {
|
||||||
|
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||||
|
},
|
||||||
|
// Disable eslint's fixAll on save if it causes style churn; turn back on once stylistic rules removed or using eslint-config-prettier
|
||||||
|
"prettier.useEditorConfig": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { getAuth, updatePassword, updateProfile } from "@firebase/auth";
|
|||||||
import { getFirestore } from "@firebase/firestore";
|
import { getFirestore } from "@firebase/firestore";
|
||||||
import { getMessaging, getToken, onMessage } from "@firebase/messaging";
|
import { getMessaging, getToken, onMessage } from "@firebase/messaging";
|
||||||
import { store } from "../redux/store";
|
import { store } from "../redux/store";
|
||||||
import * as amplitude from '@amplitude/analytics-browser';
|
//import * as amplitude from '@amplitude/analytics-browser';
|
||||||
import posthog from 'posthog-js'
|
import posthog from 'posthog-js'
|
||||||
|
|
||||||
const config = JSON.parse(import.meta.env.VITE_APP_FIREBASE_CONFIG);
|
const config = JSON.parse(import.meta.env.VITE_APP_FIREBASE_CONFIG);
|
||||||
@@ -91,14 +91,14 @@ export const logImEXEvent = (eventName, additionalParams, stateProp = null) => {
|
|||||||
// dbevent: false,
|
// dbevent: false,
|
||||||
// env: `master-AIO|${import.meta.env.VITE_APP_GIT_SHA_DATE}`
|
// env: `master-AIO|${import.meta.env.VITE_APP_GIT_SHA_DATE}`
|
||||||
// });
|
// });
|
||||||
console.log(
|
// console.log(
|
||||||
"%c[Analytics]",
|
// "%c[Analytics]",
|
||||||
"background-color: green ;font-weight:bold;",
|
// "background-color: green ;font-weight:bold;",
|
||||||
eventName,
|
// eventName,
|
||||||
eventParams
|
// eventParams
|
||||||
);
|
// );
|
||||||
logEvent(analytics, eventName, eventParams);
|
logEvent(analytics, eventName, eventParams);
|
||||||
amplitude.track(eventName, eventParams);
|
//amplitude.track(eventName, eventParams);
|
||||||
posthog.capture(eventName, eventParams);
|
posthog.capture(eventName, eventParams);
|
||||||
|
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import { persistor, store } from "./redux/store";
|
|||||||
import reportWebVitals from "./reportWebVitals";
|
import reportWebVitals from "./reportWebVitals";
|
||||||
import "./translations/i18n";
|
import "./translations/i18n";
|
||||||
import "./utils/CleanAxios";
|
import "./utils/CleanAxios";
|
||||||
import * as amplitude from "@amplitude/analytics-browser";
|
//import * as amplitude from "@amplitude/analytics-browser";
|
||||||
import { PostHogProvider } from "posthog-js/react";
|
import { PostHogProvider } from "posthog-js/react";
|
||||||
import posthog from "posthog-js";
|
import posthog from "posthog-js";
|
||||||
|
|
||||||
@@ -26,23 +26,23 @@ registerSW({ immediate: true });
|
|||||||
// Dinero.globalLocale = "en-CA";
|
// Dinero.globalLocale = "en-CA";
|
||||||
Dinero.globalRoundingMode = "HALF_EVEN";
|
Dinero.globalRoundingMode = "HALF_EVEN";
|
||||||
|
|
||||||
amplitude.init(import.meta.env.VITE_APP_AMP_KEY, {
|
// amplitude.init(import.meta.env.VITE_APP_AMP_KEY, {
|
||||||
defaultTracking: true,
|
// defaultTracking: true,
|
||||||
serverUrl: import.meta.env.VITE_APP_AMP_URL
|
// serverUrl: import.meta.env.VITE_APP_AMP_URL
|
||||||
// {
|
// // {
|
||||||
// attribution: {
|
// // attribution: {
|
||||||
// excludeReferrers: true,
|
// // excludeReferrers: true,
|
||||||
// initialEmptyValue: true,
|
// // initialEmptyValue: true,
|
||||||
// resetSessionOnNewCampaign: true,
|
// // resetSessionOnNewCampaign: true,
|
||||||
// },
|
// // },
|
||||||
// fileDownloads: true,
|
// // fileDownloads: true,
|
||||||
// formInteractions: true,
|
// // formInteractions: true,
|
||||||
// pageViews: {
|
// // pageViews: {
|
||||||
// trackHistoryChanges: 'all'
|
// // trackHistoryChanges: 'all'
|
||||||
// },
|
// // },
|
||||||
// sessions: true
|
// // sessions: true
|
||||||
// }
|
// // }
|
||||||
});
|
// });
|
||||||
|
|
||||||
posthog.init(import.meta.env.VITE_PUBLIC_POSTHOG_KEY, {
|
posthog.init(import.meta.env.VITE_PUBLIC_POSTHOG_KEY, {
|
||||||
autocapture: false,
|
autocapture: false,
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ import {
|
|||||||
validatePasswordResetSuccess
|
validatePasswordResetSuccess
|
||||||
} from "./user.actions";
|
} from "./user.actions";
|
||||||
import UserActionTypes from "./user.types";
|
import UserActionTypes from "./user.types";
|
||||||
import * as amplitude from '@amplitude/analytics-browser';
|
//import * as amplitude from '@amplitude/analytics-browser';
|
||||||
import posthog from 'posthog-js';
|
import posthog from 'posthog-js';
|
||||||
|
|
||||||
const fpPromise = FingerprintJS.load();
|
const fpPromise = FingerprintJS.load();
|
||||||
@@ -92,7 +92,7 @@ export function* isUserAuthenticated() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
LogRocket.identify(user.email);
|
LogRocket.identify(user.email);
|
||||||
amplitude.setUserId(user.email);
|
//amplitude.setUserId(user.email);
|
||||||
posthog.identify(user.email);
|
posthog.identify(user.email);
|
||||||
|
|
||||||
const eulaQuery = yield client.query({
|
const eulaQuery = yield client.query({
|
||||||
@@ -139,7 +139,7 @@ export function* signOutStart() {
|
|||||||
imexshopid: state.user.bodyshop.imexshopid,
|
imexshopid: state.user.bodyshop.imexshopid,
|
||||||
type: "messaging"
|
type: "messaging"
|
||||||
});
|
});
|
||||||
amplitude.reset();
|
//amplitude.reset();
|
||||||
} catch {
|
} catch {
|
||||||
console.log("No FCM token. Skipping unsubscribe.");
|
console.log("No FCM token. Skipping unsubscribe.");
|
||||||
}
|
}
|
||||||
@@ -365,7 +365,7 @@ export function* SetAuthLevelFromShopDetails({ payload }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
amplitude.setGroup('Shop', payload.shopname);
|
//amplitude.setGroup('Shop', payload.shopname);
|
||||||
window.$crisp.push(["set", "user:company", [payload.shopname]]);
|
window.$crisp.push(["set", "user:company", [payload.shopname]]);
|
||||||
if (authRecord[0] && authRecord[0].user.validemail) {
|
if (authRecord[0] && authRecord[0].user.validemail) {
|
||||||
window.$crisp.push(["set", "user:email", [authRecord[0].user.email]]);
|
window.$crisp.push(["set", "user:email", [authRecord[0].user.email]]);
|
||||||
|
|||||||
@@ -51,12 +51,13 @@
|
|||||||
comment: ""
|
comment: ""
|
||||||
- name: Rome Usage Report
|
- name: Rome Usage Report
|
||||||
webhook: '{{HASURA_API_URL}}/data/usagereport'
|
webhook: '{{HASURA_API_URL}}/data/usagereport'
|
||||||
schedule: 0 12 * * 5
|
schedule: 0 12 * * 3,5
|
||||||
include_in_metadata: true
|
include_in_metadata: true
|
||||||
payload: {}
|
payload: {}
|
||||||
headers:
|
headers:
|
||||||
- name: x-imex-auth
|
- name: x-imex-auth
|
||||||
value_from_env: DATAPUMP_AUTH
|
value_from_env: DATAPUMP_AUTH
|
||||||
|
comment: ""
|
||||||
- name: Task Reminders
|
- name: Task Reminders
|
||||||
webhook: '{{HASURA_API_URL}}/tasks-remind-handler'
|
webhook: '{{HASURA_API_URL}}/tasks-remind-handler'
|
||||||
schedule: '*/15 * * * *'
|
schedule: '*/15 * * * *'
|
||||||
|
|||||||
@@ -944,6 +944,7 @@
|
|||||||
- autohouseid
|
- autohouseid
|
||||||
- bill_allow_post_to_closed
|
- bill_allow_post_to_closed
|
||||||
- bill_tax_rates
|
- bill_tax_rates
|
||||||
|
- carfax_exclude
|
||||||
- cdk_configuration
|
- cdk_configuration
|
||||||
- cdk_dealerid
|
- cdk_dealerid
|
||||||
- chatterid
|
- chatterid
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-- Could not auto-generate a down migration.
|
||||||
|
-- Please write an appropriate down migration for the SQL below:
|
||||||
|
-- alter table "public"."bodyshops" add column "carfax_exclude" boolean
|
||||||
|
-- not null default 'false';
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
alter table "public"."bodyshops" add column "carfax_exclude" boolean
|
||||||
|
not null default 'false';
|
||||||
@@ -10,7 +10,8 @@
|
|||||||
"setup": "rm -rf node_modules && npm i && cd client && rm -rf node_modules && npm i",
|
"setup": "rm -rf node_modules && npm i && cd client && rm -rf node_modules && npm i",
|
||||||
"setup:win": "rimraf node_modules && npm i && cd client && rimraf node_modules && npm i",
|
"setup:win": "rimraf node_modules && npm i && cd client && rimraf node_modules && npm i",
|
||||||
"start": "node server.js",
|
"start": "node server.js",
|
||||||
"makeitpretty": "prettier --write \"**/*.{css,js,json,jsx,scss}\"",
|
"makeitpretty": "npm run format",
|
||||||
|
"format": "prettier --config .prettierrc.js --ignore-path .prettierignore --write .",
|
||||||
"lint": "eslint .",
|
"lint": "eslint .",
|
||||||
"lint:fix": "eslint . --fix",
|
"lint:fix": "eslint . --fix",
|
||||||
"test:unit": "vitest run",
|
"test:unit": "vitest run",
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ exports.default = async (req, res) => {
|
|||||||
await processShopData(shopsToProcess, start, end, skipUpload, ignoreDateFilter, allXMLResults, allErrors);
|
await processShopData(shopsToProcess, start, end, skipUpload, ignoreDateFilter, allXMLResults, allErrors);
|
||||||
|
|
||||||
await sendServerEmail({
|
await sendServerEmail({
|
||||||
subject: `CARFAX Report ${moment().format("MM-DD-YY")}`,
|
subject: `Project Mexico Report ${moment().format("MM-DD-YY")}`,
|
||||||
text: `Errors:\n${JSON.stringify(allErrors, null, 2)}\n\nUploaded:\n${JSON.stringify(
|
text: `Errors:\n${JSON.stringify(allErrors, null, 2)}\n\nUploaded:\n${JSON.stringify(
|
||||||
allXMLResults.map((x) => ({
|
allXMLResults.map((x) => ({
|
||||||
imexshopid: x.imexshopid,
|
imexshopid: x.imexshopid,
|
||||||
@@ -164,35 +164,36 @@ async function processShopData(shopsToProcess, start, end, skipUpload, ignoreDat
|
|||||||
|
|
||||||
if (skipUpload) {
|
if (skipUpload) {
|
||||||
fs.writeFileSync(`./logs/${jsonObj.filename}`, jsonObj.json);
|
fs.writeFileSync(`./logs/${jsonObj.filename}`, jsonObj.json);
|
||||||
|
uploadToS3(jsonObj);
|
||||||
} else {
|
} else {
|
||||||
await uploadViaSFTP(jsonObj);
|
await uploadViaSFTP(jsonObj);
|
||||||
}
|
|
||||||
|
|
||||||
await sendMexicoBillingEmail({
|
await sendMexicoBillingEmail({
|
||||||
subject: `${shopid.toUpperCase()}_Mexico${InstanceManager({
|
subject: `${shopid.replace(/_/g, "").toUpperCase()}_Mexico${InstanceManager({
|
||||||
imex: "IO",
|
imex: "IO",
|
||||||
rome: "RO"
|
rome: "RO"
|
||||||
})}_${moment().format("MMDDYYYY")} ROs ${jsonObj.count} Error ${errorCode(jsonObj)}`,
|
})}_${moment().format("MMDDYYYY")} ROs ${jsonObj.count} Error ${errorCode(jsonObj)}`,
|
||||||
text: `Errors:\n${JSON.stringify(
|
text: `Errors:\n${JSON.stringify(
|
||||||
erroredJobs.map((ej) => ({
|
erroredJobs.map((ej) => ({
|
||||||
ro_number: ej.job?.ro_number,
|
ro_number: ej.job?.ro_number,
|
||||||
jobid: ej.job?.id,
|
jobid: ej.job?.id,
|
||||||
error: ej.error
|
error: ej.error
|
||||||
})),
|
})),
|
||||||
null,
|
null,
|
||||||
2
|
2
|
||||||
)}\n\nUploaded:\n${JSON.stringify(
|
)}\n\nUploaded:\n${JSON.stringify(
|
||||||
{
|
{
|
||||||
bodyshopid: bodyshop.id,
|
bodyshopid: bodyshop.id,
|
||||||
imexshopid: shopid,
|
imexshopid: shopid,
|
||||||
count: jsonObj.count,
|
count: jsonObj.count,
|
||||||
filename: jsonObj.filename,
|
filename: jsonObj.filename,
|
||||||
result: jsonObj.result
|
result: jsonObj.result
|
||||||
},
|
},
|
||||||
null,
|
null,
|
||||||
2
|
2
|
||||||
)}`
|
)}`
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
allXMLResults.push({
|
allXMLResults.push({
|
||||||
bodyshopid: bodyshop.id,
|
bodyshopid: bodyshop.id,
|
||||||
@@ -292,17 +293,22 @@ const CreateRepairOrderTag = (job, errorCallback) => {
|
|||||||
v_make: job.v_make_desc || "",
|
v_make: job.v_make_desc || "",
|
||||||
v_model: job.v_model_desc || "",
|
v_model: job.v_model_desc || "",
|
||||||
|
|
||||||
date_estimated:
|
date_estimated: [job.date_estimated, job.created_at].find((date) => date)
|
||||||
(job.date_estimated && moment(job.date_estimated).tz(job.bodyshop.timezone).format(AHDateFormat)) ||
|
? moment([job.date_open, job.created_at].find((date) => date))
|
||||||
(job.created_at && moment(job.created_at).tz(job.bodyshop.timezone).format(AHDateFormat)) ||
|
.tz(job.bodyshop.timezone)
|
||||||
"",
|
.format(AHDateFormat)
|
||||||
data_opened:
|
: "",
|
||||||
(job.date_open && moment(job.date_open).tz(job.bodyshop.timezone).format(AHDateFormat)) ||
|
data_opened: [job.date_open, job.created_at].find((date) => date)
|
||||||
(job.created_at && moment(job.created_at).tz(job.bodyshop.timezone).format(AHDateFormat)) ||
|
? moment([job.date_open, job.created_at].find((date) => date))
|
||||||
"",
|
.tz(job.bodyshop.timezone)
|
||||||
date_invoiced:
|
.format(AHDateFormat)
|
||||||
(job.date_invoiced && moment(job.date_invoiced).tz(job.bodyshop.timezone).format(AHDateFormat)) || "",
|
: "",
|
||||||
loss_date: (job.loss_date && moment(job.loss_date).format(AHDateFormat)) || "",
|
date_invoiced: [job.date_invoiced, job.actual_delivery, job.actual_completion].find((date) => date)
|
||||||
|
? moment([job.date_invoiced, job.actual_delivery, job.actual_completion].find((date) => date))
|
||||||
|
.tz(job.bodyshop.timezone)
|
||||||
|
.format(AHDateFormat)
|
||||||
|
: "",
|
||||||
|
loss_date: job.loss_date ? moment(job.loss_date).format(AHDateFormat) : "",
|
||||||
|
|
||||||
ins_co_nm: job.ins_co_nm || "",
|
ins_co_nm: job.ins_co_nm || "",
|
||||||
loss_desc: job.loss_desc || "",
|
loss_desc: job.loss_desc || "",
|
||||||
@@ -329,7 +335,9 @@ const GenerateDetailLines = (line) => {
|
|||||||
line_desc: line.line_desc ? line.line_desc.replace(NON_ASCII_REGEX, "") : null,
|
line_desc: line.line_desc ? line.line_desc.replace(NON_ASCII_REGEX, "") : null,
|
||||||
oem_partno: line.oem_partno ? line.oem_partno.replace(NON_ASCII_REGEX, "") : null,
|
oem_partno: line.oem_partno ? line.oem_partno.replace(NON_ASCII_REGEX, "") : null,
|
||||||
alt_partno: line.alt_partno ? line.alt_partno.replace(NON_ASCII_REGEX, "") : null,
|
alt_partno: line.alt_partno ? line.alt_partno.replace(NON_ASCII_REGEX, "") : null,
|
||||||
|
op_code_desc: line.op_code_desc ? line.op_code_desc.replace(NON_ASCII_REGEX, "") : null,
|
||||||
lbr_ty: generateLaborType(line.mod_lbr_ty),
|
lbr_ty: generateLaborType(line.mod_lbr_ty),
|
||||||
|
lbr_hrs: line.mod_lb_hrs || 0,
|
||||||
part_qty: line.part_qty || 0,
|
part_qty: line.part_qty || 0,
|
||||||
part_type: generatePartType(line.part_type),
|
part_type: generatePartType(line.part_type),
|
||||||
act_price: line.act_price || 0
|
act_price: line.act_price || 0
|
||||||
|
|||||||
@@ -879,39 +879,43 @@ exports.CHATTER_QUERY = `query CHATTER_EXPORT($start: timestamptz, $bodyshopid:
|
|||||||
}`;
|
}`;
|
||||||
|
|
||||||
exports.CARFAX_QUERY = `query CARFAX_EXPORT($start: timestamptz, $bodyshopid: uuid!, $end: timestamptz) {
|
exports.CARFAX_QUERY = `query CARFAX_EXPORT($start: timestamptz, $bodyshopid: uuid!, $end: timestamptz) {
|
||||||
bodyshops_by_pk(id: $bodyshopid){
|
bodyshops_by_pk(id: $bodyshopid) {
|
||||||
id
|
id
|
||||||
shopname
|
shopname
|
||||||
imexshopid
|
imexshopid
|
||||||
timezone
|
timezone
|
||||||
}
|
}
|
||||||
jobs(where: {_and: [{converted: {_eq: true}}, {v_vin: {_is_null: false}}, {date_invoiced: {_gt: $start}}, {date_invoiced: {_lte: $end}}, {shopid: {_eq: $bodyshopid}}]}) {
|
jobs(where: {_and: [{_or: [{date_invoiced: {_gt: $start, _lte: $end}}, {actual_delivery: {_gt: $start, _lte: $end}, date_invoiced: {_is_null: true}}, {actual_completion: {_gt: $start, _lte: $end}, actual_delivery: {_is_null: true}, date_invoiced: {_is_null: true}}]}, {_not: {_and: [{date_invoiced: {_is_null: true}}, {actual_delivery: {_is_null: true}}, {actual_completion: {_is_null: true}}]}}, {shopid: {_eq: $bodyshopid}}, {voided: {_neq: true}}, {v_vin: {_is_null: false}}, {ro_number: {_is_null: false}}]}) {
|
||||||
id
|
actual_completion
|
||||||
|
actual_delivery
|
||||||
|
area_of_damage
|
||||||
created_at
|
created_at
|
||||||
ro_number
|
|
||||||
v_model_yr
|
|
||||||
v_model_desc
|
|
||||||
v_make_desc
|
|
||||||
v_vin
|
|
||||||
date_estimated
|
date_estimated
|
||||||
date_open
|
|
||||||
date_invoiced
|
date_invoiced
|
||||||
loss_date
|
date_open
|
||||||
|
id
|
||||||
ins_co_nm
|
ins_co_nm
|
||||||
|
job_totals
|
||||||
|
joblines(where: {removed: {_eq: false}}) {
|
||||||
|
act_price
|
||||||
|
alt_partno
|
||||||
|
line_desc
|
||||||
|
mod_lb_hrs
|
||||||
|
mod_lbr_ty
|
||||||
|
oem_partno
|
||||||
|
op_code_desc
|
||||||
|
part_type
|
||||||
|
part_qty
|
||||||
|
}
|
||||||
|
loss_date
|
||||||
loss_desc
|
loss_desc
|
||||||
|
ro_number
|
||||||
theft_ind
|
theft_ind
|
||||||
tlos_ind
|
tlos_ind
|
||||||
job_totals
|
v_make_desc
|
||||||
area_of_damage
|
v_model_desc
|
||||||
joblines(where: {removed: {_eq: false}}) {
|
v_model_yr
|
||||||
line_desc
|
v_vin
|
||||||
oem_partno
|
|
||||||
alt_partno
|
|
||||||
mod_lbr_ty
|
|
||||||
part_qty
|
|
||||||
part_type
|
|
||||||
act_price
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}`;
|
}`;
|
||||||
|
|
||||||
@@ -1854,7 +1858,7 @@ exports.GET_CHATTER_SHOPS = `query GET_CHATTER_SHOPS {
|
|||||||
}`;
|
}`;
|
||||||
|
|
||||||
exports.GET_CARFAX_SHOPS = `query GET_CARFAX_SHOPS {
|
exports.GET_CARFAX_SHOPS = `query GET_CARFAX_SHOPS {
|
||||||
bodyshops(where: {external_shop_id: {_is_null: true}}){
|
bodyshops(where: {external_shop_id: {_is_null: true}, carfax_exclude: {_neq: "true"}}){
|
||||||
id
|
id
|
||||||
shopname
|
shopname
|
||||||
imexshopid
|
imexshopid
|
||||||
|
|||||||
@@ -384,6 +384,8 @@ async function CalculateRatesTotals({ job, client }) {
|
|||||||
if (item.lbr_op === "OP14" && item.act_price > 0 && (!item.part_type || item.mod_lb_hrs === 0)) {
|
if (item.lbr_op === "OP14" && item.act_price > 0 && (!item.part_type || item.mod_lb_hrs === 0)) {
|
||||||
//Scenario where SGI may pay out hours using a part price.
|
//Scenario where SGI may pay out hours using a part price.
|
||||||
if (!ret[item.mod_lbr_ty.toLowerCase()].total) {
|
if (!ret[item.mod_lbr_ty.toLowerCase()].total) {
|
||||||
|
ret[item.mod_lbr_ty.toLowerCase()].base = Dinero();
|
||||||
|
ret[item.mod_lbr_ty.toLowerCase()].adjustment = Dinero();
|
||||||
ret[item.mod_lbr_ty.toLowerCase()].total = Dinero();
|
ret[item.mod_lbr_ty.toLowerCase()].total = Dinero();
|
||||||
}
|
}
|
||||||
ret[item.mod_lbr_ty.toLowerCase()].total = ret[item.mod_lbr_ty.toLowerCase()].total.add(
|
ret[item.mod_lbr_ty.toLowerCase()].total = ret[item.mod_lbr_ty.toLowerCase()].total.add(
|
||||||
|
|||||||
Reference in New Issue
Block a user