diff --git a/BodyshopUploader/Utils/JobProcessingQueue.cs b/BodyshopUploader/Utils/JobProcessingQueue.cs index 64be94e..50327b1 100644 --- a/BodyshopUploader/Utils/JobProcessingQueue.cs +++ b/BodyshopUploader/Utils/JobProcessingQueue.cs @@ -121,6 +121,7 @@ namespace BodyshopPartner.Utils newJob.cieca_id = item.Job.ciecaid; newJob.est_data = item.Job; newJob.ownr_name = item.Job.ownr_fn?.Value + " " + item.Job.ownr_ln?.Value; + newJob.ins_co_nm = item.Job.ins_co_nm?.Value; newJob.vehicle_info = item.Job.vehicle.data.v_model_yr.Value + " " + item.Job.vehicle.data.v_make_desc.Value + " " + item.Job.vehicle.data.v_model_desc.Value; newJob.clm_no = item.Job.clm_no?.Value; newJob.clm_amt = item.Job.clm_total?.Value; @@ -132,9 +133,13 @@ namespace BodyshopPartner.Utils newJob.est_data.vehicleid = vehuuid; } - if (await Utils.Queries.JobsQueries.CheckSupplementByClaimNo(item.Job.clm_no?.Value ?? "")) + + string jobId = await Utils.Queries.JobsQueries.CheckSupplementByClaimNo(item.Job.clm_no?.Value ?? ""); + + if (!string.IsNullOrEmpty(jobId)) { newJob.issupplement = true; + newJob.jobid = jobId; }; diff --git a/BodyshopUploader/Utils/Queries/JobsQueries.cs b/BodyshopUploader/Utils/Queries/JobsQueries.cs index 38350d6..e1e1cdb 100644 --- a/BodyshopUploader/Utils/Queries/JobsQueries.cs +++ b/BodyshopUploader/Utils/Queries/JobsQueries.cs @@ -11,10 +11,10 @@ namespace BodyshopPartner.Utils.Queries { private static NLog.Logger logger = NLog.LogManager.GetCurrentClassLogger(); - public static async Task CheckSupplementByClaimNo(string ClmNo) + public static async Task CheckSupplementByClaimNo(string ClmNo) { if (string.IsNullOrEmpty(ClmNo)) - return false; + return null; var r = new GraphQLRequest { @@ -32,18 +32,18 @@ namespace BodyshopPartner.Utils.Queries try { var d = await Utils.GraphQL.ExecuteQuery(r); - return d.jobs?.Count > 0; + return d.jobs?[1].id; } catch (ArgumentOutOfRangeException Ex) { logger.Trace(Ex, "No jobs returned in GQL query."); - return false; + return null; } catch (Exception Ex) { logger.Error(Ex, "Querying for jobs by clm_no failed."); - return false; + return null; } } } diff --git a/BodyshopUploader/Utils/QuickBooksInterop.cs b/BodyshopUploader/Utils/QuickBooksInterop.cs index d408ade..edfd69a 100644 --- a/BodyshopUploader/Utils/QuickBooksInterop.cs +++ b/BodyshopUploader/Utils/QuickBooksInterop.cs @@ -19,7 +19,6 @@ namespace BodyshopPartner.Utils private static string ticket; private static RequestProcessor2 rp; private static string maxVersion; - //public static string companyFile; //= @"C:\Users\pfic\Development\QB Testing\Testing\DANS2014.QBW"; private static QBFileMode mode = QBFileMode.qbFileOpenDoNotCare; private static string appID = "ImEXBSP"; private static string appName = "BodyshopPartner";