From 3cf56be03a21d533dc7ad7b65ba8bfdb836b27f8 Mon Sep 17 00:00:00 2001 From: Patrick Fic Date: Wed, 16 Feb 2022 13:32:23 -0800 Subject: [PATCH] IO-1739 PPG pump failing on no vehicle or totals. --- BodyshopUploader/Utils/PPGMixData.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/BodyshopUploader/Utils/PPGMixData.cs b/BodyshopUploader/Utils/PPGMixData.cs index a836bd0..9f9eb11 100644 --- a/BodyshopUploader/Utils/PPGMixData.cs +++ b/BodyshopUploader/Utils/PPGMixData.cs @@ -111,7 +111,7 @@ v_paint_codes foreach (dynamic job in data.jobs) { - + logger.Debug($"{job.ro_number}"); doc.Element("PPG").Element("DataInterface").Element("ROData").Element("RepairOrders").Add(new XElement("RO", @@ -124,15 +124,15 @@ v_paint_codes new XElement("ModelYear", job.v_model_yr?.Value), new XElement("MakeDesc", job.v_make_desc?.Value), new XElement("ModelName", job.v_model_desc?.Value), - new XElement("OEMColorCode", job.vehicle?.v_paint_codes?.Value == null ? "": job.vehicle?.v_paint_codes?.paint_cd1?.Value), + new XElement("OEMColorCode", job.vehicle?.Value != null ? job.vehicle?.v_paint_codes?.Value == null ? "" : job.vehicle?.v_paint_codes?.paint_cd1?.Value : ""), new XElement("RefinishLaborHours", job.larhrs?.aggregate?.sum.mod_lb_hrs?.Value), new XElement("InsuranceCompanyName", job.ins_co_nm?.Value), new XElement("EstimatorName", $"{job.est_ct_ln}, {job.est_ct_fn}"), - new XElement("PaintMaterialsRevenue", ((float)(job.job_totals?.rates?.mapa?.total?.amount?.Value ?? 0)) / 100), + new XElement("PaintMaterialsRevenue", ((float)(job.job_totals?.Value != null ? job.job_totals?.rates?.mapa?.total?.amount?.Value : 0)) / 100), new XElement("PaintMaterialsRate", job.rate_mapa?.Value), new XElement("BodyHours", job.labhrs?.aggregate.sum?.mod_lb_hrs?.Value), new XElement("BodyLaborRate", job.rate_lab?.Value), - new XElement("TotalCostOfRepairs", ((float)(job.job_totals?.totals?.subtotal?.amount?.Value ?? 0)) / 100) + new XElement("TotalCostOfRepairs", ((float)(job.job_totals?.Value != null ? job.job_totals?.totals?.subtotal?.amount?.Value : 0)) / 100) ));