This commit is contained in:
@@ -740,7 +740,7 @@ namespace AyaNovaQBI
|
||||
|
||||
#region Validate User settings are completed and valid
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Validate the users preferences
|
||||
@@ -910,14 +910,7 @@ namespace AyaNovaQBI
|
||||
//Validate any existing
|
||||
if (SetEverything == false && QDat.MiscExpenseChargeAs != null && QDat.MiscExpenseChargeAs != "")
|
||||
{
|
||||
//if(QBItems.Rows.Contains(QDat.MiscExpenseChargeAs))
|
||||
goto MISCCHARGEASOK;
|
||||
// else
|
||||
// {
|
||||
// MessageBox.Show("The QuickBooks Item previously set for invoicing Misc. Expense items\r\n" +
|
||||
// "No longer appears to be valid. You will next be prompted to re-select a valid \r\n" +
|
||||
// "QuickBooks Item.");
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -949,14 +942,7 @@ namespace AyaNovaQBI
|
||||
//Validate any existing
|
||||
if (SetEverything == false && QDat.WorkorderItemLoanChargeAs != null && QDat.WorkorderItemLoanChargeAs != "")
|
||||
{
|
||||
//if(QBItems.Rows.Contains(QDat.MiscExpenseChargeAs))
|
||||
goto LOANCHARGEASOK;
|
||||
// else
|
||||
// {
|
||||
// MessageBox.Show("The QuickBooks Item previously set for invoicing Misc. Expense items\r\n" +
|
||||
// "No longer appears to be valid. You will next be prompted to re-select a valid \r\n" +
|
||||
// "QuickBooks Item.");
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
@@ -1012,10 +998,6 @@ namespace AyaNovaQBI
|
||||
//also if it was empty and were not in first setup mode then
|
||||
//don't bother prompting it might be the users choice.
|
||||
|
||||
//case 3228 commented out the following as it's a bad idea
|
||||
//if (QBClasses.Rows.Count == 1 || SetEverything == false)
|
||||
// goto TRCLASSOK;
|
||||
|
||||
|
||||
//We've arrived here because there is no setting for transaction classes
|
||||
//but there are some defined in QB
|
||||
@@ -1028,7 +1010,7 @@ namespace AyaNovaQBI
|
||||
"select < Do not use classes> from the list below. Classes are off by default in QuickBooks.\r\n\r\n" +
|
||||
"This setting is Optional and not required.";
|
||||
s3.QBClasses = QBClasses;
|
||||
// s3.SelectedQBClass = TRANSACTION_CLASS_NO_CLASS_SELECTED;
|
||||
// s3.SelectedQBClass = TRANSACTION_CLASS_NO_CLASS_SELECTED;
|
||||
|
||||
if (s3.ShowDialog() == DialogResult.Cancel)
|
||||
{
|
||||
@@ -1206,8 +1188,8 @@ namespace AyaNovaQBI
|
||||
//No validation possible
|
||||
//so prompt only if not setup yet
|
||||
if (!SetEverything)
|
||||
{
|
||||
goto TBPOK;
|
||||
{
|
||||
goto TBPOK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1242,8 +1224,8 @@ namespace AyaNovaQBI
|
||||
//No validation possible
|
||||
//so prompt only if not setup yet
|
||||
if (!SetEverything)
|
||||
{
|
||||
goto SETMEMOOK;
|
||||
{
|
||||
goto SETMEMOOK;
|
||||
}
|
||||
|
||||
|
||||
@@ -1275,7 +1257,7 @@ namespace AyaNovaQBI
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
||||
//#region SetAutoCloseField Case 7
|
||||
////No validation possible
|
||||
@@ -1304,21 +1286,24 @@ namespace AyaNovaQBI
|
||||
//s6.Dispose();
|
||||
//s6 = null;
|
||||
|
||||
//SETAUTOCLOSEOK:
|
||||
//SETAUTOCLOSEOK:
|
||||
|
||||
// #endregion
|
||||
// #endregion
|
||||
|
||||
|
||||
// //Save if changes made
|
||||
// if (QDat.IsDirty)
|
||||
// {
|
||||
// //Case 299
|
||||
// QBI.AIObject = QDat.XMLData;
|
||||
// //QBI.AIObject=QDat;
|
||||
//Save if changes made
|
||||
if (QDat.IsDirty)
|
||||
{
|
||||
QBIntegration.IntegrationData = Newtonsoft.Json.JsonConvert.SerializeObject(QDat);
|
||||
ApiResponse r = await PutAsync("integration", Newtonsoft.Json.JsonConvert.SerializeObject(QBIntegration));
|
||||
QBIntegration = r.ObjectResponse["data"].ToObject<Integration>();
|
||||
////Case 299
|
||||
//QBI.AIObject = QDat.XMLData;
|
||||
////QBI.AIObject=QDat;
|
||||
|
||||
// QBI = (Integration)QBI.Save();
|
||||
// QDat.IsDirty = false;
|
||||
// }
|
||||
//QBI = (Integration)QBI.Save();
|
||||
QDat.IsDirty = false;
|
||||
}
|
||||
|
||||
return pfstat.OK;
|
||||
}
|
||||
@@ -1615,7 +1600,6 @@ namespace AyaNovaQBI
|
||||
w.Ops = "Reading from QuickBooks...";
|
||||
|
||||
|
||||
|
||||
w.Step = "Classes";
|
||||
await PopulateQBClassCacheAsync();
|
||||
|
||||
@@ -2853,8 +2837,6 @@ namespace AyaNovaQBI
|
||||
|
||||
#endregion quickbooks Vendors
|
||||
|
||||
|
||||
|
||||
#region QuickBooks "accounts"
|
||||
|
||||
|
||||
@@ -3116,7 +3098,7 @@ namespace AyaNovaQBI
|
||||
|
||||
#endregion quickbooks Terms
|
||||
|
||||
#endregion
|
||||
#endregion QB api helper methods end
|
||||
|
||||
#region AyaNova cached lists
|
||||
public async static Task PopulateAyaListCache()
|
||||
@@ -3256,7 +3238,6 @@ namespace AyaNovaQBI
|
||||
|
||||
#endregion ayanova parts
|
||||
|
||||
|
||||
#region AyaNova WorkOrder STATUS list
|
||||
|
||||
private static List<WorkOrderStatus> _woStatuslist = null;
|
||||
@@ -3281,7 +3262,7 @@ namespace AyaNovaQBI
|
||||
|
||||
#region Translations
|
||||
|
||||
private static Dictionary<string,string> _translist = null;
|
||||
private static Dictionary<string, string> _translist = null;
|
||||
/// <summary>
|
||||
/// AyaNova part list
|
||||
/// </summary>
|
||||
@@ -3295,11 +3276,11 @@ namespace AyaNovaQBI
|
||||
|
||||
public static async Task PopulateAyaTranslationList()
|
||||
{
|
||||
|
||||
|
||||
var a = await PostAsync("translation/subset", Newtonsoft.Json.JsonConvert.SerializeObject(new List<string> {
|
||||
"WorkOrderStatus","OK", "Cancel"
|
||||
}));
|
||||
//this weirdness is required because it comes from the server as a json collection of objects with {Key:"blahkey", value:"blahvalue"} rather than what newtonsoft expects for a dictionary which is [{key:"blahvalue"},{key:"blahvalue2"}]
|
||||
//this weirdness is required because it comes from the server as a json collection of objects with {Key:"blahkey", value:"blahvalue"} rather than what newtonsoft expects for a dictionary which is [{key:"blahvalue"},{key:"blahvalue2"}]
|
||||
var v = a.ObjectResponse["data"].ToObject<List<KeyValuePair<string, string>>>();
|
||||
_translist = v.ToDictionary((keyItem) => keyItem.Key, (valueItem) => valueItem.Value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user