diff --git a/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs b/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs index b0b43cb..eca6d38 100644 --- a/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs +++ b/BodyshopUploader/Utils/Decoder/EstimateDecoder.cs @@ -264,6 +264,35 @@ namespace BodyshopPartner.Utils.Decoder ownerRoot.ownr_ea = readValues[101]; ownerRoot.shopid = AppMetaData.ActiveShopId; + + //Validate that the owner is not empty. If it is, use the insured. + if (String.IsNullOrEmpty(ownerRoot.ownr_ln?.Value) && String.IsNullOrEmpty(ownerRoot.ownr_fn?.Value) && String.IsNullOrEmpty(ownerRoot.ownr_co_nm?.Value)) + { + logger.Debug("Owner FN/LN/CO NM were all empty. Using insured information instead."); + j.ownr_ln = readValues[68]; + j.ownr_fn = readValues[69]; + j.ownr_title = readValues[70]; + j.ownr_co_nm = readValues[71]; + j.ownr_addr1 = readValues[72]; + j.ownr_addr2 = readValues[73]; + j.ownr_city = readValues[74]; + j.ownr_st = readValues[75]; + j.ownr_zip = readValues[76]; + j.ownr_ctry = readValues[77]; + j.ownr_ph1 = readValues[78]; + if (String.IsNullOrWhiteSpace(ownerRoot.ownr_ph1.Value)) + { + ownerRoot.ownr_ph1 = readValues[80]; + } + //j.insd_ph1x = readValues[79]; + // j.insd_ph2 = readValues[80]; + // j.insd_ph2x = readValues[81]; + + j.ownr_ea = readValues[84]; + + } + + j.owner = new JObject(); j.owner.data = ownerRoot; reader.Dispose(); @@ -1145,6 +1174,7 @@ namespace BodyshopPartner.Utils.Decoder dynamic ttl_x = new JObject(); ttl_x.g_ttl_amt = readValues[0];//G_TTL_AMT ttl_x.g_bett_amt = readValues[1];//G_BETT_AMT + j.depreciation_taxes = readValues[1]; //Store Betterment IO-1324 ttl_x.g_rpd_amt = readValues[2];//G_RPD_AMT ttl_x.g_ded_amt = readValues[3];//G_DED_AMT ttl_x.g_cust_amt = readValues[4];//G_CUST_AMT