From 16b66a165884824ccee614aeefa674fa5d2737af Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Fri, 18 Dec 2020 14:52:46 -0800 Subject: [PATCH 1/7] Package updates. --- electron/changelog.json | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/electron/changelog.json b/electron/changelog.json index c4810cb..8e74c0e 100644 --- a/electron/changelog.json +++ b/electron/changelog.json @@ -28,5 +28,10 @@ "title": "Release Notes for 1.0.14", "date": "12/18/2020", "notes": "Bug Fixes: \n- Resolved an issue where launching a second instance of RPS could cause the program to occasionally freeze.\n- Fixed an issue where date filtering could include dates outside the range depending on time zone.\n- Added negative RPS calculations on combined estimate lines like assemblies." + }, + "1.0.15": { + "title": "Release Notes for 1.0.15", + "date": "TBD", + "notes": "" } } diff --git a/package.json b/package.json index db48ca6..83475a2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "productName": "ImEX RPS", "author": "ImEX Systems Inc. ", "description": "ImEX RPS", - "version": "1.0.14", + "version": "1.0.15", "main": "electron/main.js", "homepage": "./", "dependencies": { From 990d99e15deed0b7d089d2cf9d85f64781d03795 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Mon, 11 Jan 2021 10:16:31 -0800 Subject: [PATCH 2/7] Updated git ignore. --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 35e9e76..0b5ceac 100644 --- a/.gitignore +++ b/.gitignore @@ -106,3 +106,4 @@ firebase/.yarn-integrity # dotenv environment variables file firebase/.env +.eslintcache From 9eca8dee4589334d9dbcf4293249ae4dbbc0d46d Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 12 Jan 2021 11:33:22 -0800 Subject: [PATCH 3/7] Added comments for new todo on line ignore logic. --- electron/decoder/decoder.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/electron/decoder/decoder.js b/electron/decoder/decoder.js index c726b90..652d696 100644 --- a/electron/decoder/decoder.js +++ b/electron/decoder/decoder.js @@ -372,6 +372,10 @@ async function DecodeLinFile(extensionlessFilePath) { // jobline.db_price = jobline.act_price; // } + //*****TODO LINE**** + //Any PAL, Remanufactured, Recycled, Aftermarket, Used, + // If DB Price 0, ignore them. + //RPS-46 Ignore NA Line Items. if ( jobline.part_type === "PAN" && From 9add09cedce86f71bccd6b753fe48c5a7892ffa3 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 12 Jan 2021 11:36:55 -0800 Subject: [PATCH 4/7] Fixed typo on groupings page RPS-73 --- .../molecules/jobs-group-modal/jobs-group-modal.molecule.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/molecules/jobs-group-modal/jobs-group-modal.molecule.jsx b/src/components/molecules/jobs-group-modal/jobs-group-modal.molecule.jsx index 136a5b1..e6035ed 100644 --- a/src/components/molecules/jobs-group-modal/jobs-group-modal.molecule.jsx +++ b/src/components/molecules/jobs-group-modal/jobs-group-modal.molecule.jsx @@ -23,7 +23,8 @@ const data = [ "MERCEDES BENZ", "RAM-Van", "GENESIS", - "AUDI BMW-Truck", + "AUDI", + "BMW-Truck", ], }, { From f8030a5c5f43b06d92d8e7e3a29a14093868b0bd Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 12 Jan 2021 11:42:21 -0800 Subject: [PATCH 5/7] Renamed close date to R4P RPS-76 --- WIP Changelog.txt | 6 ++---- .../close-date-display/close-date-display.molecule.jsx | 2 +- .../jobs-detail-description.molecule.jsx | 4 ++-- .../molecules/jobs-list-item/jobs-list-item.molecule.jsx | 2 +- .../jobs-search-fields/jobs-search-fields.molecule.jsx | 2 +- .../molecules/reporting-dates/reporting-dates.molecule.jsx | 2 +- .../reporting-jobs-list/reporting-jobs-list.molecule.jsx | 4 ++-- 7 files changed, 10 insertions(+), 12 deletions(-) diff --git a/WIP Changelog.txt b/WIP Changelog.txt index cccc10f..641f726 100644 --- a/WIP Changelog.txt +++ b/WIP Changelog.txt @@ -1,7 +1,5 @@ New Features: -- Added 'This Quarter' and 'Last Quarter' date quick select. +- Renamed 'Close Date' to 'Ready for Payment' to better align with MPI terminology. Bug Fixes: -- Resolved an issue where launching a second instance of RPS would cause the program to freeze. -- Date filtering will now ensure only correct dates are reported on, regardless of time zone. -- Added negative RPS calculations on combined estimate lines like assemblies. \ No newline at end of file +- Updated grouping typo on group lookup popup. \ No newline at end of file diff --git a/src/components/molecules/close-date-display/close-date-display.molecule.jsx b/src/components/molecules/close-date-display/close-date-display.molecule.jsx index 7618087..f2b80ac 100644 --- a/src/components/molecules/close-date-display/close-date-display.molecule.jsx +++ b/src/components/molecules/close-date-display/close-date-display.molecule.jsx @@ -24,7 +24,7 @@ export default function CloseDateDisplayMolecule({ jobId, close_date }) { }); if (!result.errors) { - message.success("Close date updated."); + message.success("R4P date updated."); } else { message.error("Error updating job."); } diff --git a/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx b/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx index 19286a6..4ad8981 100644 --- a/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx +++ b/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx @@ -42,8 +42,8 @@ export default function JobsDetailDescriptionMolecule({ loading, job }) { - Close Date + + Ready for Payment Date } > diff --git a/src/components/molecules/jobs-list-item/jobs-list-item.molecule.jsx b/src/components/molecules/jobs-list-item/jobs-list-item.molecule.jsx index b4bae83..9a29feb 100644 --- a/src/components/molecules/jobs-list-item/jobs-list-item.molecule.jsx +++ b/src/components/molecules/jobs-list-item/jobs-list-item.molecule.jsx @@ -59,7 +59,7 @@ export function JobsListItemMolecule({ {item.clm_no || "No Claim Number"} {!item.close_date && ( )} diff --git a/src/components/molecules/jobs-search-fields/jobs-search-fields.molecule.jsx b/src/components/molecules/jobs-search-fields/jobs-search-fields.molecule.jsx index b5b2c65..ec198d6 100644 --- a/src/components/molecules/jobs-search-fields/jobs-search-fields.molecule.jsx +++ b/src/components/molecules/jobs-search-fields/jobs-search-fields.molecule.jsx @@ -40,7 +40,7 @@ export default function JobsSearchFieldsMolecule({ callSearchQuery }) { - Only Jobs with No Close Date + Only Jobs with No Ready For Payment Date {() => { diff --git a/src/components/molecules/reporting-dates/reporting-dates.molecule.jsx b/src/components/molecules/reporting-dates/reporting-dates.molecule.jsx index f380f4d..72bc710 100644 --- a/src/components/molecules/reporting-dates/reporting-dates.molecule.jsx +++ b/src/components/molecules/reporting-dates/reporting-dates.molecule.jsx @@ -29,7 +29,7 @@ export function ReportingDatesMolecule({ queryReportingData }) {
diff --git a/src/components/molecules/reporting-jobs-list/reporting-jobs-list.molecule.jsx b/src/components/molecules/reporting-jobs-list/reporting-jobs-list.molecule.jsx index a697395..3733240 100644 --- a/src/components/molecules/reporting-jobs-list/reporting-jobs-list.molecule.jsx +++ b/src/components/molecules/reporting-jobs-list/reporting-jobs-list.molecule.jsx @@ -9,7 +9,7 @@ import { setSelectedJobId } from "../../../redux/application/application.actions import { selectReportData, selectReportLoading, - selectScorecard + selectScorecard, } from "../../../redux/reporting/reporting.selectors"; import { alphaSort } from "../../../util/sorters"; import VehicleGroupAlertAtom from "../../atoms/vehicle-group-alert/vehicle-group-alert.atom"; @@ -46,7 +46,7 @@ export function ReportingJobsListMolecule({ sorter: (a, b) => alphaSort(a.clm_no, b.clm_no), }, { - title: "Close Date", + title: "Ready for Payment Date", dataIndex: "close_date", key: "close_date", render: (text, record) => moment(record.close_date).format("MM/DD/yyyy"), From ea2a3975f61ac646aebc6bb1cacf536c40448850 Mon Sep 17 00:00:00 2001 From: Patrick Fic <> Date: Tue, 12 Jan 2021 12:01:21 -0800 Subject: [PATCH 6/7] Adedd age calculation based on close date. RPS-75 --- .../close-date-display.molecule.jsx | 15 +++++++++++++-- .../jobs-detail-description.molecule.jsx | 1 + src/graphql/jobs.queries.js | 1 + src/ipc/ipc-estimate-utils.js | 19 +++++++++++++------ 4 files changed, 28 insertions(+), 8 deletions(-) diff --git a/src/components/molecules/close-date-display/close-date-display.molecule.jsx b/src/components/molecules/close-date-display/close-date-display.molecule.jsx index f2b80ac..ef9b716 100644 --- a/src/components/molecules/close-date-display/close-date-display.molecule.jsx +++ b/src/components/molecules/close-date-display/close-date-display.molecule.jsx @@ -5,9 +5,11 @@ import moment from "moment"; import React, { useState } from "react"; import { UPDATE_JOB } from "../../../graphql/jobs.queries"; import ipcTypes from "../../../ipc.types"; +import { CalculateVehicleAge } from "../../../ipc/ipc-estimate-utils"; import { DateFormat } from "../../../util/constants"; const { ipcRenderer } = window; -export default function CloseDateDisplayMolecule({ jobId, close_date }) { + +export default function CloseDateDisplayMolecule({ job, jobId, close_date }) { const [editMode, setEditMode] = useState(false); const [value, setValue] = useState(moment(close_date)); const [loading, setLoading] = useState(false); @@ -19,8 +21,17 @@ export default function CloseDateDisplayMolecule({ jobId, close_date }) { }); setLoading(true); setValue(newDate); + + //Recalculate vehicle age. + const result = await updateJob({ - variables: { jobId: jobId, job: { close_date: newDate } }, + variables: { + jobId: jobId, + job: { + close_date: newDate, + v_age: CalculateVehicleAge({ ...job, close_date: newDate }), + }, + }, }); if (!result.errors) { diff --git a/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx b/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx index 4ad8981..43601a2 100644 --- a/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx +++ b/src/components/molecules/jobs-detail-description/jobs-detail-description.molecule.jsx @@ -48,6 +48,7 @@ export default function JobsDetailDescriptionMolecule({ loading, job }) { } > diff --git a/src/graphql/jobs.queries.js b/src/graphql/jobs.queries.js index 6c35e10..3025ddd 100644 --- a/src/graphql/jobs.queries.js +++ b/src/graphql/jobs.queries.js @@ -151,6 +151,7 @@ export const UPDATE_JOB = gql` ro_number updated_at close_date + v_age joblines(order_by: { unq_seq: asc }) { id act_price diff --git a/src/ipc/ipc-estimate-utils.js b/src/ipc/ipc-estimate-utils.js index 3c85b23..3c9ab58 100644 --- a/src/ipc/ipc-estimate-utils.js +++ b/src/ipc/ipc-estimate-utils.js @@ -12,21 +12,28 @@ import { QUERY_GROUPS_BY_MAKE_TYPE } from "../graphql/veh_group.queries"; import { store } from "../redux/store"; const { logger } = window; +export function CalculateVehicleAge(job) { + const parsedYr = parseInt(job.v_model_yr); + + let ret = + moment(job.close_date || new Date()).year() - + (parsedYr >= 0 ? 2000 + parsedYr : 1900 + parsedYr); + + if (ret < 0) ret = 0; + + return ret; +} + export async function UpsertEstimate(job) { const shopId = store.getState().user.bodyshop.id; logger.info("Beginning Upserting job from Renderer."); - const parsedYr = parseInt(job.v_model_yr); job = { ...job, group: await DetermineVehicleGroup(job), - v_age: - moment(job.loss_date).year() - - (parsedYr >= 0 ? 2000 + parsedYr : 1900 + parsedYr), + v_age: CalculateVehicleAge(job), }; - if (job.v_age < 0) job.v_age = 0; - const existingJobs = await client.query({ query: QUERY_JOB_BY_CLM_NO, variables: { clm_no: job.clm_no }, From 4737a394e75577de1e5d00af353b1188e9c0988a Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Tue, 12 Jan 2021 12:37:03 -0800 Subject: [PATCH 7/7] V1.0.15 changelog items. --- WIP Changelog.txt | 1 + electron/changelog.json | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/WIP Changelog.txt b/WIP Changelog.txt index 641f726..3709afa 100644 --- a/WIP Changelog.txt +++ b/WIP Changelog.txt @@ -1,5 +1,6 @@ New Features: - Renamed 'Close Date' to 'Ready for Payment' to better align with MPI terminology. +- Changed vehicle age calculation to use 'Ready for Payment' instead of loss date as per new MPI practices. Bug Fixes: - Updated grouping typo on group lookup popup. \ No newline at end of file diff --git a/electron/changelog.json b/electron/changelog.json index 8e74c0e..d37226b 100644 --- a/electron/changelog.json +++ b/electron/changelog.json @@ -31,7 +31,7 @@ }, "1.0.15": { "title": "Release Notes for 1.0.15", - "date": "TBD", - "notes": "" + "date": "01/12/2021", + "notes": "New Features: \n- Renamed 'Close Date' to 'Ready for Payment' to better align with MPI terminology.\n- Changed vehicle age calculation to use 'Ready for Payment' instead of loss date as per new MPI practices.\n\nBug Fixes: \n- Updated grouping typo on group lookup popup." } }