diff --git a/WIP Changelog.txt b/WIP Changelog.txt index e96b546..97da817 100644 --- a/WIP Changelog.txt +++ b/WIP Changelog.txt @@ -1,9 +1,4 @@ New Features: -- Implemented the new vehicle groupings by MPI. -- Implemented new model based group detection to provide more accurate groupings than relying solely on the estimating system. * -- Added group verification to disable alerts and track whether a grouping has already been reviewed and confirmed. - +- Bug Fixes: -- Updated ignore logic for recycled glass. - -* Please send feedback on the model groupings if you notice any issues to support@thinkimex.com. \ No newline at end of file +- Updated rare bug in vehicle age calculation. \ No newline at end of file diff --git a/src/ipc/ipc-estimate-utils.js b/src/ipc/ipc-estimate-utils.js index cc2015a..28284a1 100644 --- a/src/ipc/ipc-estimate-utils.js +++ b/src/ipc/ipc-estimate-utils.js @@ -19,9 +19,10 @@ 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); + const vehicleYr = + moment().year() - 2000 > parsedYr ? 2000 + parsedYr : 1900 + parsedYr; + + let ret = moment(job.close_date || new Date()).year() - vehicleYr; if (ret < 0) ret = 0;