Merged in v1.0.15 (pull request #18)

V1.0.15
This commit is contained in:
Patrick Fic
2021-01-12 20:56:13 +00:00
14 changed files with 52 additions and 22 deletions

1
.gitignore vendored
View File

@@ -106,3 +106,4 @@ firebase/.yarn-integrity
# dotenv environment variables file # dotenv environment variables file
firebase/.env firebase/.env
.eslintcache

View File

@@ -1,7 +1,6 @@
New Features: New Features:
- Added 'This Quarter' and 'Last Quarter' date quick select. - 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: Bug Fixes:
- Resolved an issue where launching a second instance of RPS would cause the program to freeze. - Updated grouping typo on group lookup popup.
- 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.

View File

@@ -28,5 +28,10 @@
"title": "Release Notes for 1.0.14", "title": "Release Notes for 1.0.14",
"date": "12/18/2020", "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." "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": "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."
} }
} }

View File

@@ -372,6 +372,10 @@ async function DecodeLinFile(extensionlessFilePath) {
// jobline.db_price = jobline.act_price; // 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. //RPS-46 Ignore NA Line Items.
if ( if (
jobline.part_type === "PAN" && jobline.part_type === "PAN" &&

View File

@@ -3,7 +3,7 @@
"productName": "ImEX RPS", "productName": "ImEX RPS",
"author": "ImEX Systems Inc. <support@thinkimex.com>", "author": "ImEX Systems Inc. <support@thinkimex.com>",
"description": "ImEX RPS", "description": "ImEX RPS",
"version": "1.0.14", "version": "1.0.15",
"main": "electron/main.js", "main": "electron/main.js",
"homepage": "./", "homepage": "./",
"dependencies": { "dependencies": {

View File

@@ -5,9 +5,11 @@ import moment from "moment";
import React, { useState } from "react"; import React, { useState } from "react";
import { UPDATE_JOB } from "../../../graphql/jobs.queries"; import { UPDATE_JOB } from "../../../graphql/jobs.queries";
import ipcTypes from "../../../ipc.types"; import ipcTypes from "../../../ipc.types";
import { CalculateVehicleAge } from "../../../ipc/ipc-estimate-utils";
import { DateFormat } from "../../../util/constants"; import { DateFormat } from "../../../util/constants";
const { ipcRenderer } = window; const { ipcRenderer } = window;
export default function CloseDateDisplayMolecule({ jobId, close_date }) {
export default function CloseDateDisplayMolecule({ job, jobId, close_date }) {
const [editMode, setEditMode] = useState(false); const [editMode, setEditMode] = useState(false);
const [value, setValue] = useState(moment(close_date)); const [value, setValue] = useState(moment(close_date));
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
@@ -19,12 +21,21 @@ export default function CloseDateDisplayMolecule({ jobId, close_date }) {
}); });
setLoading(true); setLoading(true);
setValue(newDate); setValue(newDate);
//Recalculate vehicle age.
const result = await updateJob({ 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) { if (!result.errors) {
message.success("Close date updated."); message.success("R4P date updated.");
} else { } else {
message.error("Error updating job."); message.error("Error updating job.");
} }

View File

@@ -42,12 +42,13 @@ export default function JobsDetailDescriptionMolecule({ loading, job }) {
<Descriptions.Item <Descriptions.Item
label={ label={
<Tooltip title="This is the date you will submit for payment from MPI."> <Tooltip title="This is the date you will submit for payment from MPI. This should always be the latest date in the case of supplements.">
Close Date Ready for Payment Date
</Tooltip> </Tooltip>
} }
> >
<CloseDateDisplayMolecule <CloseDateDisplayMolecule
job={job}
jobId={job.id} jobId={job.id}
close_date={job.close_date} close_date={job.close_date}
/> />

View File

@@ -23,7 +23,8 @@ const data = [
"MERCEDES BENZ", "MERCEDES BENZ",
"RAM-Van", "RAM-Van",
"GENESIS", "GENESIS",
"AUDI BMW-Truck", "AUDI",
"BMW-Truck",
], ],
}, },
{ {

View File

@@ -59,7 +59,7 @@ export function JobsListItemMolecule({
{item.clm_no || "No Claim Number"} {item.clm_no || "No Claim Number"}
{!item.close_date && ( {!item.close_date && (
<WarningOutlined <WarningOutlined
title="No close date has been set for this job." title="No Ready for Payment Date has been set for this job."
style={{ marginLeft: ".5rem", color: "orange" }} style={{ marginLeft: ".5rem", color: "orange" }}
/> />
)} )}

View File

@@ -40,7 +40,7 @@ export default function JobsSearchFieldsMolecule({ callSearchQuery }) {
<DatePicker.RangePicker /> <DatePicker.RangePicker />
</Form.Item> </Form.Item>
<Form.Item name="closeDateIsNull" valuePropName="checked"> <Form.Item name="closeDateIsNull" valuePropName="checked">
<Checkbox>Only Jobs with No Close Date</Checkbox> <Checkbox>Only Jobs with No Ready For Payment Date</Checkbox>
</Form.Item> </Form.Item>
<Form.Item shouldUpdate> <Form.Item shouldUpdate>
{() => { {() => {

View File

@@ -29,7 +29,7 @@ export function ReportingDatesMolecule({ queryReportingData }) {
<Form form={form} onFinish={handleFinish}> <Form form={form} onFinish={handleFinish}>
<div style={{ display: "flex" }}> <div style={{ display: "flex" }}>
<Form.Item <Form.Item
label="Close Date Between" label="Ready for Payment Date Between"
name="dateRange" name="dateRange"
rules={[{ type: "array", required: true }]} rules={[{ type: "array", required: true }]}
> >

View File

@@ -9,7 +9,7 @@ import { setSelectedJobId } from "../../../redux/application/application.actions
import { import {
selectReportData, selectReportData,
selectReportLoading, selectReportLoading,
selectScorecard selectScorecard,
} from "../../../redux/reporting/reporting.selectors"; } from "../../../redux/reporting/reporting.selectors";
import { alphaSort } from "../../../util/sorters"; import { alphaSort } from "../../../util/sorters";
import VehicleGroupAlertAtom from "../../atoms/vehicle-group-alert/vehicle-group-alert.atom"; 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), sorter: (a, b) => alphaSort(a.clm_no, b.clm_no),
}, },
{ {
title: "Close Date", title: "Ready for Payment Date",
dataIndex: "close_date", dataIndex: "close_date",
key: "close_date", key: "close_date",
render: (text, record) => moment(record.close_date).format("MM/DD/yyyy"), render: (text, record) => moment(record.close_date).format("MM/DD/yyyy"),

View File

@@ -151,6 +151,7 @@ export const UPDATE_JOB = gql`
ro_number ro_number
updated_at updated_at
close_date close_date
v_age
joblines(order_by: { unq_seq: asc }) { joblines(order_by: { unq_seq: asc }) {
id id
act_price act_price

View File

@@ -12,21 +12,28 @@ import { QUERY_GROUPS_BY_MAKE_TYPE } from "../graphql/veh_group.queries";
import { store } from "../redux/store"; import { store } from "../redux/store";
const { logger } = window; 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) { export async function UpsertEstimate(job) {
const shopId = store.getState().user.bodyshop.id; const shopId = store.getState().user.bodyshop.id;
logger.info("Beginning Upserting job from Renderer."); logger.info("Beginning Upserting job from Renderer.");
const parsedYr = parseInt(job.v_model_yr);
job = { job = {
...job, ...job,
group: await DetermineVehicleGroup(job), group: await DetermineVehicleGroup(job),
v_age: v_age: CalculateVehicleAge(job),
moment(job.loss_date).year() -
(parsedYr >= 0 ? 2000 + parsedYr : 1900 + parsedYr),
}; };
if (job.v_age < 0) job.v_age = 0;
const existingJobs = await client.query({ const existingJobs = await client.query({
query: QUERY_JOB_BY_CLM_NO, query: QUERY_JOB_BY_CLM_NO,
variables: { clm_no: job.clm_no }, variables: { clm_no: job.clm_no },