From 4ccb1f3a54da85ee1dff416310cc124f59053d48 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Thu, 4 Mar 2021 13:07:14 -0800 Subject: [PATCH] Adjusted mapa and mash rate extraction IO-718 --- BodyshopUploader/Releases/RELEASES | 4 +- .../Utils/Decoder/EstimateDecoder.cs | 40 +++++++++---------- 2 files changed, 23 insertions(+), 21 deletions(-) diff --git a/BodyshopUploader/Releases/RELEASES b/BodyshopUploader/Releases/RELEASES index 2f9da72..c362bcf 100644 --- a/BodyshopUploader/Releases/RELEASES +++ b/BodyshopUploader/Releases/RELEASES @@ -6,4 +6,6 @@ F2D64AFC971565D6A6AB3C69D39918BA651D2BB3 ImEXOnlinePartner-1.0.2-full.nupkg 4938 B28BABEA8C23215EE92CD691B8F69CEEC40D04C8 ImEXOnlinePartner-1.0.3-delta.nupkg 30700 CA43E2BC60A8A67126609C5682AA3D39D68D2400 ImEXOnlinePartner-1.0.3-full.nupkg 4935967 46500AB5ADA0E5E7367EE77C708977BDFA2BDD4D ImEXOnlinePartner-1.0.4-delta.nupkg 48821 -CB63B87719141FDE534A108AC6831B707AB064DE ImEXOnlinePartner-1.0.4-full.nupkg 4938065 \ No newline at end of file +CB63B87719141FDE534A108AC6831B707AB064DE ImEXOnlinePartner-1.0.4-full.nupkg 4938065 +C5117C0E0E58EF10C4FA6104274493FBFD231362 ImEXOnlinePartner-1.0.5-delta.nupkg 40888 +A1502201673BAFC13E7A3A5B398124B6A484F545 ImEXOnlinePartner-1.0.5-full.nupkg 4938758 \ No newline at end of file diff --git a/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs b/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs index a4b1be1..9c4049c 100644 --- a/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs +++ b/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs @@ -627,13 +627,13 @@ namespace BodyshopPartner.Utils.Decoder "CAL_SECP", "MAT_CALP", - "CAL_PRETHR", + "CAL_PRETHR", //Mitchell here "CAL_PSTTHR", "CAL_THRAMT", "CAL_LBRMIN", - "CAL_LBRRTE", + "CAL_LBRRTE", //Audatex puts it here "CAL_OPCODE", "TAX_IND", @@ -657,32 +657,32 @@ namespace BodyshopPartner.Utils.Decoder { //TODO: Import MAXDLR for every type. case "MAPA": - j.rate_mapa = readValues[7]; + j.rate_mapa = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.? j.tax_paint_mat_rt = float.Parse(readValues[14].ToString()) / 100; break; case "MASH": - j.rate_mash = readValues[7]; + j.rate_mash = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.? j.tax_shop_mat_rt = float.Parse(readValues[14].ToString()) / 100; break; case "MAHW": //TODO Should the remainder of these be index 7 or 11? - j.rate_mahw = readValues[7]; + j.rate_mahw = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.? j.tax_levies_rt = float.Parse(readValues[14].ToString()) / 100; break; case "MA2S": - j.rate_ma2s = readValues[7]; + j.rate_ma2s = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.? break; case "MA2T": - j.rate_ma2t = readValues[7]; + j.rate_ma2t = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.? break; case "MA3S": - j.rate_ma3s = readValues[7]; + j.rate_ma3s = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.? break; case "MACS": - j.rate_macs = readValues[7]; + j.rate_macs = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.? break; case "MABL": - j.rate_mabl = readValues[7]; + j.rate_mabl = float.Parse(readValues[11].ToString()) != 0 ? readValues[11] : readValues[7]; //Use CAL_LBRRTE if exists, otherwise us the pre threshold amt.? break; default: logger.Error("Unknown type value present in PFM file. {0}:{1}", readValues[0].ToString(), readValues[2]); @@ -768,7 +768,7 @@ namespace BodyshopPartner.Utils.Decoder "TRIM_COLOR", "V_MLDGCODE", "V_ENGINE", - + "V_MILEAGE", "V_COLOR", "V_TONE", "V_STAGE", @@ -800,15 +800,15 @@ namespace BodyshopPartner.Utils.Decoder v.v_trimcode = readValues[14]?.ToString(); v.trim_color = readValues[15]?.ToString(); v.v_mldgcode = readValues[16]?.ToString(); - v.v_engine = readValues[17]?.ToString(); - v.v_color = readValues[18]?.ToString(); - v.v_tone = readValues[19]?.ToString(); - v.v_stage = readValues[20]?.ToString(); + v.v_engine = readValues[18]?.ToString(); + v.v_color = readValues[19]?.ToString(); + v.v_tone = readValues[20]?.ToString(); + v.v_stage = readValues[21]?.ToString(); dynamic p = new JObject(); - p.paint_cd1 = readValues[21]?.ToString(); - p.paint_cd2 = readValues[22]?.ToString(); - p.paint_cd3 = readValues[23]?.ToString(); + p.paint_cd1 = readValues[22]?.ToString(); + p.paint_cd2 = readValues[23]?.ToString(); + p.paint_cd3 = readValues[24]?.ToString(); v.v_paint_codes = p; j.vehicle = new JObject(); @@ -821,8 +821,8 @@ namespace BodyshopPartner.Utils.Decoder j.v_model_yr = readValues[8]?.ToString(); j.v_make_desc = readValues[10]?.ToString(); j.v_model_desc = readValues[11]?.ToString(); - j.v_color = readValues[18]?.ToString(); - + j.v_color = readValues[19]?.ToString(); + j.kmin = readValues[18]; v.shopid = AppMetaData.ActiveShopId; } return;