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
firebase/.env
.eslintcache

View File

@@ -1,7 +1,6 @@
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:
- 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.
- Updated grouping typo on group lookup popup.

View File

@@ -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": "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;
// }
//*****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" &&

View File

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

View File

@@ -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,12 +21,21 @@ 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) {
message.success("Close date updated.");
message.success("R4P date updated.");
} else {
message.error("Error updating job.");
}

View File

@@ -42,12 +42,13 @@ export default function JobsDetailDescriptionMolecule({ loading, job }) {
<Descriptions.Item
label={
<Tooltip title="This is the date you will submit for payment from MPI.">
Close Date
<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.">
Ready for Payment Date
</Tooltip>
}
>
<CloseDateDisplayMolecule
job={job}
jobId={job.id}
close_date={job.close_date}
/>

View File

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

View File

@@ -59,7 +59,7 @@ export function JobsListItemMolecule({
{item.clm_no || "No Claim Number"}
{!item.close_date && (
<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" }}
/>
)}

View File

@@ -40,7 +40,7 @@ export default function JobsSearchFieldsMolecule({ callSearchQuery }) {
<DatePicker.RangePicker />
</Form.Item>
<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 shouldUpdate>
{() => {

View File

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

View File

@@ -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"),

View File

@@ -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

View File

@@ -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 },