From 7362d1b9db2813fa60ebbd8847fafc4870ef26c7 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Fri, 17 Dec 2021 08:32:49 -0800 Subject: [PATCH 1/4] IO-1570 Update clear of line status. --- .../job-line-status-popup/job-line-status-popup.component.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/components/job-line-status-popup/job-line-status-popup.component.jsx b/client/src/components/job-line-status-popup/job-line-status-popup.component.jsx index c6c760378..d47379f2b 100644 --- a/client/src/components/job-line-status-popup/job-line-status-popup.component.jsx +++ b/client/src/components/job-line-status-popup/job-line-status-popup.component.jsx @@ -61,6 +61,7 @@ export function JobLineStatusPopup({ bodyshop, jobline, disabled }) { value={status} onSelect={handleChange} onBlur={handleSave} + onClear={() => handleChange(null)} > {Object.values(bodyshop.md_order_statuses).map((s, idx) => ( From 70329757092c6ce68196c5a1303c2049a2a1d994 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Fri, 17 Dec 2021 08:35:07 -0800 Subject: [PATCH 2/4] IO-1552 Autohouse Validation --- .vscode/settings.json | 4 ++++ server/data/autohouse.js | 23 ++++++++++++++--------- server/graphql-client/queries.js | 2 +- 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 75e6b0da2..dd6a1330b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -3,6 +3,10 @@ { "pattern": "**/Test.xml", "systemId": "file:///Users/pfic/Downloads/IMEX.xsd" + }, + { + "pattern": "**/IMEX.xml", + "systemId": "logs/IMEX.xsd" } ] } diff --git a/server/data/autohouse.js b/server/data/autohouse.js index 1475ceccf..c8941e88b 100644 --- a/server/data/autohouse.js +++ b/server/data/autohouse.js @@ -5,6 +5,7 @@ const moment = require("moment"); var builder = require("xmlbuilder2"); const _ = require("lodash"); const logger = require("../utils/logger"); +const fs = require("fs"); require("dotenv").config({ path: path.resolve( process.cwd(), @@ -47,7 +48,7 @@ exports.default = async (req, res) => { try { const { jobs } = await client.request(queries.AUTOHOUSE_QUERY, { bodyshopid: bodyshop.id, - start: moment().subtract(30, "days").startOf("day"), + start: moment().subtract(3, "days").startOf("day"), }); const autoHouseObject = { @@ -111,13 +112,16 @@ exports.default = async (req, res) => { }); } } - res.json(allxmlsToUpload); - if (process.env.NODE_ENV !== "production") { - res.json(allxmlsToUpload); - return; + //if (process.env.NODE_ENV !== "production") { + for (const xmlObj of allxmlsToUpload) { + fs.writeFileSync(`./logs/${xmlObj.filename}`, xmlObj.xml); } + res.json(allxmlsToUpload); + return; + // } + let sftp = new Client(); sftp.on("error", (errors) => logger.log("autohouse-sftp-error", "ERROR", "api", null, { @@ -631,8 +635,9 @@ const CreateCosts = (job) => { billTotalsByCostCenters[defaultCosts.PAP] || Dinero() ), PartsAMCost: billTotalsByCostCenters[defaultCosts.PAA] || Dinero(), - PartsReconditionedCost: Dinero(), - PartsRecycledCost: billTotalsByCostCenters[defaultCosts.PAR] || Dinero(), + PartsReconditionedCost: + billTotalsByCostCenters[defaultCosts.PAM] || Dinero(), + PartsRecycledCost: billTotalsByCostCenters[defaultCosts.PAL] || Dinero(), PartsOtherCost: billTotalsByCostCenters[defaultCosts.PAO] || Dinero(), SubletTotalCost: billTotalsByCostCenters[defaultCosts.PAS] || Dinero(), BodyLaborTotalCost: ticketTotalsByCostCenter[defaultCosts.LAB] || Dinero(), @@ -700,7 +705,7 @@ const GenerateDetailLines = (line, statuses) => { OrderedOn: null, OriginalCost: null, OriginalInvoiceNumber: null, - PriceEach: (line.billlines[0] && line.billlines[0].actual_cost) || 0, + PriceEach: (line.billlines[0] && line.billlines[0].retail_price) || 0, PartNumber: _.escape(line.oem_partno), ProfitPercent: null, PurchaseOrderNumber: null, @@ -717,7 +722,7 @@ const GenerateDetailLines = (line, statuses) => { OrderedBy: null, ShipVia: null, VendorContact: null, - EstimateAmount: line.act_price || 0, + EstimateAmount: line.act_price * line.part_qty || 0, //Rebecca }; return ret; }; diff --git a/server/graphql-client/queries.js b/server/graphql-client/queries.js index bac54912b..86459e3d1 100644 --- a/server/graphql-client/queries.js +++ b/server/graphql-client/queries.js @@ -525,7 +525,7 @@ exports.QUERY_EMPLOYEE_PIN = `query QUERY_EMPLOYEE_PIN($shopId: uuid!, $employee }`; exports.AUTOHOUSE_QUERY = `query AUTOHOUSE_EXPORT($start: timestamptz, $bodyshopid: uuid!) { - jobs(where: {_and: [{converted: {_eq: true}}, {updated_at: {_gt: $start}}, {shopid: {_eq: $bodyshopid}}]} ) { + jobs(where: {_and: [{converted: {_eq: true}}, {updated_at: {_gt: $start}}, {shopid: {_eq: $bodyshopid}}]}) { id ro_number status From f42ef0749a4dd5a50348780296122ee5944910cf Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Fri, 17 Dec 2021 09:54:47 -0800 Subject: [PATCH 3/4] IO-244 IOU updates. --- ...accounting-receivables-table.component.jsx | 13 +--------- .../job-line-note-popup.component.jsx | 24 +++++++++---------- ...bs-detail-header-actions.duplicate.util.js | 2 +- 3 files changed, 14 insertions(+), 25 deletions(-) diff --git a/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx b/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx index 8029816e5..e03d1fa24 100644 --- a/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx +++ b/client/src/components/accounting-receivables-table/accounting-receivables-table.component.jsx @@ -110,13 +110,6 @@ export function AccountingReceivablesTableComponent({ sorter: (a, b) => alphaSort(a.clm_no, b.clm_no), sortOrder: state.sortedInfo.columnKey === "clm_no" && state.sortedInfo.order, - render: (text, record) => { - return record.clm_no ? ( - {record.clm_no} - ) : ( - t("general.labels.unknown") - ); - }, }, { title: t("jobs.fields.clm_total"), @@ -126,11 +119,7 @@ export function AccountingReceivablesTableComponent({ sortOrder: state.sortedInfo.columnKey === "clm_total" && state.sortedInfo.order, render: (text, record) => { - return record.clm_total ? ( - {record.clm_total} - ) : ( - t("general.labels.unknown") - ); + return {record.clm_total}; }, }, { diff --git a/client/src/components/job-line-note-popup/job-line-note-popup.component.jsx b/client/src/components/job-line-note-popup/job-line-note-popup.component.jsx index ccc43ed7f..76836a6a8 100644 --- a/client/src/components/job-line-note-popup/job-line-note-popup.component.jsx +++ b/client/src/components/job-line-note-popup/job-line-note-popup.component.jsx @@ -1,10 +1,10 @@ -import React, { useState, useEffect } from "react"; -import { Input, notification, Space } from "antd"; import { FieldTimeOutlined } from "@ant-design/icons"; -import LoadingSpinner from "../loading-spinner/loading-spinner.component"; import { useMutation } from "@apollo/client"; -import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries"; +import { Input, notification } from "antd"; +import React, { useEffect, useState } from "react"; import { useTranslation } from "react-i18next"; +import { UPDATE_JOB_LINE } from "../../graphql/jobs-lines.queries"; +import LoadingSpinner from "../loading-spinner/loading-spinner.component"; export default function JobLineNotePopup({ jobline, disabled }) { const [editing, setEditing] = useState(false); @@ -57,21 +57,21 @@ export default function JobLineNotePopup({ jobline, disabled }) { ); return (
- {jobline.ioucreated && ( - - - {t("joblines.labels.ioucreated")} - - )}
!disabled && setEditing(true)} > - {jobline.notes} + {jobline.ioucreated && ( +
+ + {t("joblines.labels.ioucreated")} +
+ )} + {jobline.notes || null}
); diff --git a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js index 8220e00b4..fc5b9c0ca 100644 --- a/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js +++ b/client/src/components/jobs-detail-header-actions/jobs-detail-header-actions.duplicate.util.js @@ -109,7 +109,7 @@ export async function CreateIouForJob( delete line.id; delete line.__typename; line.oem_partno = `${line.oem_partno ? `${line.oem_partno} - ` : ``}IOU $${ - line.act_price || 0 + (line.act_price && line.act_price.toFixed(2)) || 0 }/${line.mod_lb_hrs || 0}hrs`; line.act_price = 0; line.mod_lb_hrs = 0; From 3247de6cf63db39567517600812f1ced36b31249 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Fri, 17 Dec 2021 09:55:12 -0800 Subject: [PATCH 4/4] IO-1569 Change image selector color. --- client/src/App/App.styles.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/src/App/App.styles.scss b/client/src/App/App.styles.scss index b49fdcb1e..ccaf3b89f 100644 --- a/client/src/App/App.styles.scss +++ b/client/src/App/App.styles.scss @@ -134,3 +134,11 @@ background: unset; } } + +.ReactGridGallery_tile-icon-bar { + div { + svg { + fill: #1890ff; + } + } +}