This commit is contained in:
@@ -568,8 +568,8 @@ namespace AyaNovaQBI
|
|||||||
if (string.IsNullOrWhiteSpace(QBIntegration.IntegrationData) || QBIntegration.Items.Count == 0)
|
if (string.IsNullOrWhiteSpace(QBIntegration.IntegrationData) || QBIntegration.Items.Count == 0)
|
||||||
return true;//nothing mapped or set to validate return to mainform for initial setup to be triggered
|
return true;//nothing mapped or set to validate return to mainform for initial setup to be triggered
|
||||||
|
|
||||||
//PFC - verify integration mapped objects still exist at each end (Util.PreFlightCheck() line 199)
|
//PFC - verify integration mapped objects still exist in QB
|
||||||
if (!await ValidateMap(initErrors))
|
if (!await ValidateQuickBooksHasMappedItems(initErrors))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//DONE
|
//DONE
|
||||||
@@ -637,11 +637,11 @@ namespace AyaNovaQBI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Ensure existance of QBI Integration object
|
/// Ensure mapped items still existing in QuickBooks
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="initErrors"></param>
|
/// <param name="initErrors"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static async Task<bool> ValidateMap(StringBuilder initErrors)
|
public static async Task<bool> ValidateQuickBooksHasMappedItems(StringBuilder initErrors)
|
||||||
{
|
{
|
||||||
//Missing links table:
|
//Missing links table:
|
||||||
DataTable dtTemp = new DataTable();
|
DataTable dtTemp = new DataTable();
|
||||||
@@ -695,16 +695,9 @@ namespace AyaNovaQBI
|
|||||||
{
|
{
|
||||||
await IntegrationLog("PFC: User opted to remove all mappings after double warning.");
|
await IntegrationLog("PFC: User opted to remove all mappings after double warning.");
|
||||||
QBIntegration.Items.Clear();
|
QBIntegration.Items.Clear();
|
||||||
//foreach (DataRow row in dtTemp.Rows)
|
|
||||||
//{
|
|
||||||
// QBIntegration.Items.Remove(row["MAPID"].ToString());
|
|
||||||
//}
|
|
||||||
//TODO: POST BACK TO SERVER
|
|
||||||
//Exists, fetch it check if active then we're done here
|
//Exists, fetch it check if active then we're done here
|
||||||
ApiResponse r = await PostAsync($"integration/{QBI_INTEGRATION_ID}", Newtonsoft.Json.JsonConvert.SerializeObject(QBIntegration));
|
ApiResponse r = await PostAsync($"integration/{QBI_INTEGRATION_ID}", Newtonsoft.Json.JsonConvert.SerializeObject(QBIntegration));
|
||||||
QBIntegration = r.ObjectResponse["data"].ToObject<Integration>();
|
QBIntegration = r.ObjectResponse["data"].ToObject<Integration>();
|
||||||
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user