Updated issue where old close date not used for calculation of age RPS-75

This commit is contained in:
Patrick Fic
2021-01-12 13:07:26 -08:00
parent 573691c953
commit be709d51e1
4 changed files with 17 additions and 7 deletions

View File

@@ -33,5 +33,10 @@
"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."
},
"1.0.16": {
"title": "Release Notes for 1.0.16",
"date": "01/12/2021",
"notes": "Bug Fixes: \n- Resolved an issue where vehicle age was calculated using an old date."
}
}

View File

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

View File

@@ -119,6 +119,7 @@ export const QUERY_JOB_BY_CLM_NO = gql`
query QUERY_JOB_BY_CLM_NO($clm_no: String!) {
jobs(where: { clm_no: { _eq: $clm_no } }) {
id
close_date
joblines {
id
act_price

View File

@@ -28,17 +28,21 @@ export async function UpsertEstimate(job) {
const shopId = store.getState().user.bodyshop.id;
logger.info("Beginning Upserting job from Renderer.");
job = {
...job,
group: await DetermineVehicleGroup(job),
v_age: CalculateVehicleAge(job),
};
const existingJobs = await client.query({
query: QUERY_JOB_BY_CLM_NO,
variables: { clm_no: job.clm_no },
});
job = {
...job,
group: await DetermineVehicleGroup(job),
v_age: CalculateVehicleAge({
...job,
close_date:
existingJobs.data.jobs[0] && existingJobs.data.jobs[0].close_date,
}),
};
if (existingJobs.data.jobs.length === 1) {
let suppDelta = await GetSupplementDelta(
existingJobs.data.jobs[0].id,