IO-1739 PPG pump failing on no vehicle or totals.

This commit is contained in:
Patrick Fic
2022-02-16 13:32:23 -08:00
parent f32c149bae
commit 3cf56be03a

View File

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