This commit is contained in:
2022-07-01 19:01:02 +00:00
parent 71b6249a33
commit 7365f74250
6 changed files with 38 additions and 55 deletions

View File

@@ -39,27 +39,27 @@
// //
this.lblCompany.Dock = System.Windows.Forms.DockStyle.Top; this.lblCompany.Dock = System.Windows.Forms.DockStyle.Top;
this.lblCompany.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblCompany.Font = new System.Drawing.Font("Tahoma", 14.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblCompany.Location = new System.Drawing.Point(0, 0); this.lblCompany.Location = new System.Drawing.Point(16, 16);
this.lblCompany.Name = "lblCompany"; this.lblCompany.Name = "lblCompany";
this.lblCompany.Size = new System.Drawing.Size(522, 30); this.lblCompany.Size = new System.Drawing.Size(490, 30);
this.lblCompany.TabIndex = 0; this.lblCompany.TabIndex = 0;
this.lblCompany.Text = "A company"; this.lblCompany.Text = "A company";
// //
// lblPath // lblPath
// //
this.lblPath.Dock = System.Windows.Forms.DockStyle.Top; this.lblPath.Dock = System.Windows.Forms.DockStyle.Top;
this.lblPath.Location = new System.Drawing.Point(0, 30); this.lblPath.Location = new System.Drawing.Point(16, 46);
this.lblPath.Name = "lblPath"; this.lblPath.Name = "lblPath";
this.lblPath.Size = new System.Drawing.Size(522, 37); this.lblPath.Size = new System.Drawing.Size(490, 37);
this.lblPath.TabIndex = 1; this.lblPath.TabIndex = 1;
// //
// lblExplain // lblExplain
// //
this.lblExplain.Dock = System.Windows.Forms.DockStyle.Top; this.lblExplain.Dock = System.Windows.Forms.DockStyle.Top;
this.lblExplain.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblExplain.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblExplain.Location = new System.Drawing.Point(0, 67); this.lblExplain.Location = new System.Drawing.Point(16, 83);
this.lblExplain.Name = "lblExplain"; this.lblExplain.Name = "lblExplain";
this.lblExplain.Size = new System.Drawing.Size(522, 23); this.lblExplain.Size = new System.Drawing.Size(490, 23);
this.lblExplain.TabIndex = 2; this.lblExplain.TabIndex = 2;
this.lblExplain.Text = "AyaNova QBI will work with this company file"; this.lblExplain.Text = "AyaNova QBI will work with this company file";
// //
@@ -98,6 +98,7 @@
this.Controls.Add(this.lblCompany); this.Controls.Add(this.lblCompany);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Name = "ApproveCompanyFile"; this.Name = "ApproveCompanyFile";
this.Padding = new System.Windows.Forms.Padding(16);
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "ApproveCompanyFile"; this.Text = "ApproveCompanyFile";

View File

@@ -26,7 +26,8 @@ namespace AyaNovaQBI
public DataTable QBItems { get; set; } public DataTable QBItems { get; set; }
public string SelectedQBItem { get; set; } public string SelectedQBItem { get => (string)cbQBItems.SelectedValue; set { } }
//private string _selectedQBItem;
private void SetQBChargeAsLoad(object sender, EventArgs e) private void SetQBChargeAsLoad(object sender, EventArgs e)
{ {

View File

@@ -20,8 +20,8 @@ namespace AyaNovaQBI
public DataTable QBClasses { get; set; } public DataTable QBClasses { get; set; }
public string SelectedQBClass { get; set; }
public string SelectedQBClass { get => (string)cbQBClasses.SelectedValue; set { } }
private void SetQBClass_load(object sender, EventArgs e) private void SetQBClass_load(object sender, EventArgs e)
{ {

View File

@@ -20,8 +20,8 @@ namespace AyaNovaQBI
public DataTable QBInvoiceTemplates { get; set; } public DataTable QBInvoiceTemplates { get; set; }
public string SelectedQBInvoiceTemplate { get; set; }
public string SelectedQBInvoiceTemplate { get => (string)cbQBItems.SelectedValue; set { } }
private void SetQBClass_load(object sender, EventArgs e) private void SetQBClass_load(object sender, EventArgs e)
{ {

View File

@@ -20,8 +20,8 @@ namespace AyaNovaQBI
public DataTable QBTerms { get; set; } public DataTable QBTerms { get; set; }
public string SelectedQBTerm { get; set; }
public string SelectedQBTerm { get => (string)cbQBTerms.SelectedValue; set { } }
private void SetQBClass_load(object sender, EventArgs e) private void SetQBClass_load(object sender, EventArgs e)
{ {

View File

@@ -740,7 +740,7 @@ namespace AyaNovaQBI
#region Validate User settings are completed and valid #region Validate User settings are completed and valid
/// <summary> /// <summary>
/// Validate the users preferences /// Validate the users preferences
@@ -910,14 +910,7 @@ namespace AyaNovaQBI
//Validate any existing //Validate any existing
if (SetEverything == false && QDat.MiscExpenseChargeAs != null && QDat.MiscExpenseChargeAs != "") if (SetEverything == false && QDat.MiscExpenseChargeAs != null && QDat.MiscExpenseChargeAs != "")
{ {
//if(QBItems.Rows.Contains(QDat.MiscExpenseChargeAs))
goto MISCCHARGEASOK; 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 //Validate any existing
if (SetEverything == false && QDat.WorkorderItemLoanChargeAs != null && QDat.WorkorderItemLoanChargeAs != "") if (SetEverything == false && QDat.WorkorderItemLoanChargeAs != null && QDat.WorkorderItemLoanChargeAs != "")
{ {
//if(QBItems.Rows.Contains(QDat.MiscExpenseChargeAs))
goto LOANCHARGEASOK; 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 //also if it was empty and were not in first setup mode then
//don't bother prompting it might be the users choice. //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 //We've arrived here because there is no setting for transaction classes
//but there are some defined in QB //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" + "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."; "This setting is Optional and not required.";
s3.QBClasses = QBClasses; s3.QBClasses = QBClasses;
// s3.SelectedQBClass = TRANSACTION_CLASS_NO_CLASS_SELECTED; // s3.SelectedQBClass = TRANSACTION_CLASS_NO_CLASS_SELECTED;
if (s3.ShowDialog() == DialogResult.Cancel) if (s3.ShowDialog() == DialogResult.Cancel)
{ {
@@ -1206,8 +1188,8 @@ namespace AyaNovaQBI
//No validation possible //No validation possible
//so prompt only if not setup yet //so prompt only if not setup yet
if (!SetEverything) if (!SetEverything)
{ {
goto TBPOK; goto TBPOK;
} }
@@ -1242,8 +1224,8 @@ namespace AyaNovaQBI
//No validation possible //No validation possible
//so prompt only if not setup yet //so prompt only if not setup yet
if (!SetEverything) if (!SetEverything)
{ {
goto SETMEMOOK; goto SETMEMOOK;
} }
@@ -1275,7 +1257,7 @@ namespace AyaNovaQBI
#endregion #endregion
//#region SetAutoCloseField Case 7 //#region SetAutoCloseField Case 7
////No validation possible ////No validation possible
@@ -1304,21 +1286,24 @@ namespace AyaNovaQBI
//s6.Dispose(); //s6.Dispose();
//s6 = null; //s6 = null;
//SETAUTOCLOSEOK: //SETAUTOCLOSEOK:
// #endregion // #endregion
// //Save if changes made //Save if changes made
// if (QDat.IsDirty) if (QDat.IsDirty)
// { {
// //Case 299 QBIntegration.IntegrationData = Newtonsoft.Json.JsonConvert.SerializeObject(QDat);
// QBI.AIObject = QDat.XMLData; ApiResponse r = await PutAsync("integration", Newtonsoft.Json.JsonConvert.SerializeObject(QBIntegration));
// //QBI.AIObject=QDat; QBIntegration = r.ObjectResponse["data"].ToObject<Integration>();
////Case 299
//QBI.AIObject = QDat.XMLData;
////QBI.AIObject=QDat;
// QBI = (Integration)QBI.Save(); //QBI = (Integration)QBI.Save();
// QDat.IsDirty = false; QDat.IsDirty = false;
// } }
return pfstat.OK; return pfstat.OK;
} }
@@ -1615,7 +1600,6 @@ namespace AyaNovaQBI
w.Ops = "Reading from QuickBooks..."; w.Ops = "Reading from QuickBooks...";
w.Step = "Classes"; w.Step = "Classes";
await PopulateQBClassCacheAsync(); await PopulateQBClassCacheAsync();
@@ -2853,8 +2837,6 @@ namespace AyaNovaQBI
#endregion quickbooks Vendors #endregion quickbooks Vendors
#region QuickBooks "accounts" #region QuickBooks "accounts"
@@ -3116,7 +3098,7 @@ namespace AyaNovaQBI
#endregion quickbooks Terms #endregion quickbooks Terms
#endregion #endregion QB api helper methods end
#region AyaNova cached lists #region AyaNova cached lists
public async static Task PopulateAyaListCache() public async static Task PopulateAyaListCache()
@@ -3256,7 +3238,6 @@ namespace AyaNovaQBI
#endregion ayanova parts #endregion ayanova parts
#region AyaNova WorkOrder STATUS list #region AyaNova WorkOrder STATUS list
private static List<WorkOrderStatus> _woStatuslist = null; private static List<WorkOrderStatus> _woStatuslist = null;
@@ -3281,7 +3262,7 @@ namespace AyaNovaQBI
#region Translations #region Translations
private static Dictionary<string,string> _translist = null; private static Dictionary<string, string> _translist = null;
/// <summary> /// <summary>
/// AyaNova part list /// AyaNova part list
/// </summary> /// </summary>
@@ -3295,11 +3276,11 @@ namespace AyaNovaQBI
public static async Task PopulateAyaTranslationList() public static async Task PopulateAyaTranslationList()
{ {
var a = await PostAsync("translation/subset", Newtonsoft.Json.JsonConvert.SerializeObject(new List<string> { var a = await PostAsync("translation/subset", Newtonsoft.Json.JsonConvert.SerializeObject(new List<string> {
"WorkOrderStatus","OK", "Cancel" "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>>>(); var v = a.ObjectResponse["data"].ToObject<List<KeyValuePair<string, string>>>();
_translist = v.ToDictionary((keyItem) => keyItem.Key, (valueItem) => valueItem.Value); _translist = v.ToDictionary((keyItem) => keyItem.Key, (valueItem) => valueItem.Value);