This commit is contained in:
2022-07-07 13:53:26 +00:00
parent 929421468d
commit 627ad48a9d
3 changed files with 88 additions and 86 deletions

View File

@@ -28,10 +28,10 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle();
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.objectToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.customersToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -39,13 +39,13 @@
this.travelRatesToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.partsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.vendorsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.linkSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.exportSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.updateSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.showToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.allItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.linkedItemsOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.unlinkedItemsOnlyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.linkSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.importSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.updateSelectedItemsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.autoLinkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.gridAya = new System.Windows.Forms.DataGridView();
this.AyaName = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -72,7 +72,7 @@
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.objectToolStripMenuItem,
this.linkSelectedItemsToolStripMenuItem,
this.importSelectedItemsToolStripMenuItem,
this.exportSelectedItemsToolStripMenuItem,
this.updateSelectedItemsToolStripMenuItem,
this.showToolStripMenuItem,
this.autoLinkToolStripMenuItem});
@@ -136,6 +136,28 @@
this.vendorsToolStripMenuItem.Text = "&Vendors";
this.vendorsToolStripMenuItem.Click += new System.EventHandler(this.vendorsToolStripMenuItem_Click);
//
// linkSelectedItemsToolStripMenuItem
//
this.linkSelectedItemsToolStripMenuItem.Name = "linkSelectedItemsToolStripMenuItem";
this.linkSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(119, 20);
this.linkSelectedItemsToolStripMenuItem.Text = "&Link selected items";
this.linkSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.linkSelectedItemsToolStripMenuItem_Click);
//
// exportSelectedItemsToolStripMenuItem
//
this.exportSelectedItemsToolStripMenuItem.Name = "exportSelectedItemsToolStripMenuItem";
this.exportSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(131, 20);
this.exportSelectedItemsToolStripMenuItem.Text = "&Export selected items";
this.exportSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.exportSelectedItemsToolStripMenuItem_Click);
//
// updateSelectedItemsToolStripMenuItem
//
this.updateSelectedItemsToolStripMenuItem.Name = "updateSelectedItemsToolStripMenuItem";
this.updateSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(135, 20);
this.updateSelectedItemsToolStripMenuItem.Text = "&Update selected items";
this.updateSelectedItemsToolStripMenuItem.Visible = false;
this.updateSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.updateSelectedItemsToolStripMenuItem_Click);
//
// showToolStripMenuItem
//
this.showToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -152,7 +174,7 @@
this.allItemsToolStripMenuItem.CheckOnClick = true;
this.allItemsToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
this.allItemsToolStripMenuItem.Name = "allItemsToolStripMenuItem";
this.allItemsToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.allItemsToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.allItemsToolStripMenuItem.Tag = "all";
this.allItemsToolStripMenuItem.Text = "&All items";
this.allItemsToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click);
@@ -161,7 +183,7 @@
//
this.linkedItemsOnlyToolStripMenuItem.CheckOnClick = true;
this.linkedItemsOnlyToolStripMenuItem.Name = "linkedItemsOnlyToolStripMenuItem";
this.linkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.linkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.linkedItemsOnlyToolStripMenuItem.Tag = "linked";
this.linkedItemsOnlyToolStripMenuItem.Text = "&Linked items only";
this.linkedItemsOnlyToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click);
@@ -170,33 +192,11 @@
//
this.unlinkedItemsOnlyToolStripMenuItem.CheckOnClick = true;
this.unlinkedItemsOnlyToolStripMenuItem.Name = "unlinkedItemsOnlyToolStripMenuItem";
this.unlinkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(180, 22);
this.unlinkedItemsOnlyToolStripMenuItem.Size = new System.Drawing.Size(179, 22);
this.unlinkedItemsOnlyToolStripMenuItem.Tag = "unlinked";
this.unlinkedItemsOnlyToolStripMenuItem.Text = "&Unlinked items only";
this.unlinkedItemsOnlyToolStripMenuItem.Click += new System.EventHandler(this.showSubItemToolStripMenuItem_Click);
//
// linkSelectedItemsToolStripMenuItem
//
this.linkSelectedItemsToolStripMenuItem.Name = "linkSelectedItemsToolStripMenuItem";
this.linkSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(119, 20);
this.linkSelectedItemsToolStripMenuItem.Text = "&Link selected items";
this.linkSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.linkSelectedItemsToolStripMenuItem_Click);
//
// importSelectedItemsToolStripMenuItem
//
this.importSelectedItemsToolStripMenuItem.Name = "importSelectedItemsToolStripMenuItem";
this.importSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(133, 20);
this.importSelectedItemsToolStripMenuItem.Text = "&Import selected items";
this.importSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.importSelectedItemsToolStripMenuItem_Click);
//
// updateSelectedItemsToolStripMenuItem
//
this.updateSelectedItemsToolStripMenuItem.Name = "updateSelectedItemsToolStripMenuItem";
this.updateSelectedItemsToolStripMenuItem.Size = new System.Drawing.Size(135, 20);
this.updateSelectedItemsToolStripMenuItem.Text = "&Update selected items";
this.updateSelectedItemsToolStripMenuItem.Visible = false;
this.updateSelectedItemsToolStripMenuItem.Click += new System.EventHandler(this.updateSelectedItemsToolStripMenuItem_Click);
//
// autoLinkToolStripMenuItem
//
this.autoLinkToolStripMenuItem.Name = "autoLinkToolStripMenuItem";
@@ -209,17 +209,17 @@
this.gridAya.AllowUserToAddRows = false;
this.gridAya.AllowUserToDeleteRows = false;
this.gridAya.AllowUserToResizeRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
this.gridAya.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
dataGridViewCellStyle9.BackColor = System.Drawing.Color.WhiteSmoke;
this.gridAya.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
this.gridAya.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.gridAya.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle10.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.gridAya.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
this.gridAya.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridAya.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.AyaName,
@@ -266,17 +266,17 @@
this.gridQB.AllowUserToAddRows = false;
this.gridQB.AllowUserToDeleteRows = false;
this.gridQB.AllowUserToResizeRows = false;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke;
this.gridQB.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
dataGridViewCellStyle11.BackColor = System.Drawing.Color.WhiteSmoke;
this.gridQB.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle11;
this.gridQB.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.gridQB.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
dataGridViewCellStyle12.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle12.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle12.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
dataGridViewCellStyle12.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle12.SelectionBackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle12.SelectionForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.gridQB.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle12;
this.gridQB.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.gridQB.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dataGridViewTextBoxColumn1,
@@ -404,7 +404,7 @@
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ToolStripMenuItem importSelectedItemsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem exportSelectedItemsToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem linkSelectedItemsToolStripMenuItem;
private System.Windows.Forms.DataGridViewTextBoxColumn AyaName;
private System.Windows.Forms.DataGridViewTextBoxColumn linked;

View File

@@ -11,7 +11,7 @@ namespace AyaNovaQBI
{
/*
TODO:
test updating all object types both ways, have tested vendors and customers only, in particular parts and part price only test
*/
public partial class Map : Form
@@ -61,8 +61,8 @@ namespace AyaNovaQBI
#region IMPORT
private async void importSelectedItemsToolStripMenuItem_Click(object sender, EventArgs e)
#region EXPORT
private async void exportSelectedItemsToolStripMenuItem_Click(object sender, EventArgs e)
{
bool IsAyaGrid = false;
if (gridAya.SelectedRows.Count == 0 && gridQB.SelectedRows.Count == 0) return;
@@ -74,14 +74,14 @@ namespace AyaNovaQBI
if (IsAyaGrid)
{
if (MessageBox.Show(
"Import and link the selected AyaNova objects into QuickBooks.\r\n\r\n" +
"Are you sure?", "Import AyaNova objects", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
"Export and link the selected AyaNova objects into QuickBooks.\r\n\r\n" +
"Are you sure?", "Export AyaNova objects", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No) return;
await ImportToQuickBooks();
await ExportToQuickBooks();
w = new Waiting();
w.Show();
w.Ops = $"Import completed";
w.Ops = $"Export completed";
switch (_Type)
{
case AyaType.Customer:
@@ -104,13 +104,13 @@ namespace AyaNovaQBI
else
{
if (MessageBox.Show(
"Import and link the selected QuickBooks objects into AyaNova.\r\n\r\n" +
"Are you sure?", "Import QuickBooks objects", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
"Export and link the selected QuickBooks objects into AyaNova.\r\n\r\n" +
"Are you sure?", "Export QuickBooks objects", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
== DialogResult.No) return;
await ImportToAyaNova();
await ExportToAyaNova();
w = new Waiting();
w.Show();
w.Ops = $"Import completed";
w.Ops = $"Export completed";
switch (_Type)
{
@@ -141,7 +141,7 @@ namespace AyaNovaQBI
{
if (w != null)
w.Visible = false;
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ImportSelectedItems");
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ExportSelectedItems");
}
finally
{
@@ -154,14 +154,14 @@ namespace AyaNovaQBI
#region Import to AyaNova
private async Task ImportToAyaNova()
private async Task ExportToAyaNova()
{
this.Refresh();
Cursor.Current = Cursors.WaitCursor;
ArrayList alErrors = new ArrayList();
Waiting w = new Waiting();
w.Show();
w.Ops = "Importing from QuickBooks...";
w.Ops = "Exporting from QuickBooks...";
try
{
menuStrip1.Enabled = gridQB.Enabled = gridAya.Enabled = false;
@@ -192,7 +192,7 @@ namespace AyaNovaQBI
break;
default:
throw new System.NotSupportedException("ImportToAyaNova: NOT SUPPORTED (STUB): " + _Type.ToString());
throw new System.NotSupportedException("ExportFromQuickBooks: NOT SUPPORTED type : " + _Type.ToString());
}
}
@@ -202,7 +202,7 @@ namespace AyaNovaQBI
w.Visible = false;
StringBuilder sb = new StringBuilder();
sb.Append("Import completed with some errors:\r\n\r\n");
sb.Append("Export completed with some errors:\r\n\r\n");
foreach (object o in alErrors)
{
sb.Append((string)o);
@@ -217,7 +217,7 @@ namespace AyaNovaQBI
catch (Exception ex)
{
w.Visible = false;
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ImportToAyaNova");
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ExportToAyaNova");
}
finally
{
@@ -226,18 +226,18 @@ namespace AyaNovaQBI
}
}
#endregion Import to AyaNova
#endregion Export to AyaNova
#region Import to QuickBooks
#region Export to QuickBooks
private async Task ImportToQuickBooks()
private async Task ExportToQuickBooks()
{
Refresh();
Cursor.Current = Cursors.WaitCursor;
ArrayList alErrors = new ArrayList();
Waiting w = new Waiting();
w.Show();
w.Ops = "Importing from AyaNova...";
w.Ops = "Exporting from AyaNova...";
try
{
bool firstPass = true;
@@ -303,7 +303,7 @@ namespace AyaNovaQBI
}
break;
default:
throw new System.NotSupportedException("ImportToQuickBooks: NOT SUPPORTED (STUB): " + _Type.ToString());
throw new System.NotSupportedException("ExportToQuickBooks: NOT SUPPORTED type: " + _Type.ToString());
}
}
@@ -315,7 +315,7 @@ namespace AyaNovaQBI
w.Visible = false;
StringBuilder sb = new StringBuilder();
sb.Append("Import completed with some errors:\r\n\r\n");
sb.Append("Export completed with some errors:\r\n\r\n");
foreach (object o in alErrors)
{
sb.Append((string)o);
@@ -332,7 +332,7 @@ namespace AyaNovaQBI
catch (Exception ex)
{
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ImportToQuickBooks");
await util.CrackDisplayAndIntegrationLogException(ex, "QBI:Map:ExportToQuickBooks");
}
finally
{
@@ -340,10 +340,10 @@ namespace AyaNovaQBI
w.Close();
}
}
#endregion importtoqb
#endregion exporttoqb
#endregion import
#endregion export
#region AUTOMATIC LINK
private async void autoLinkToolStripMenuItem_Click(object sender, EventArgs e)

View File

@@ -3378,7 +3378,9 @@ namespace AyaNovaQBI
{
throw new ApplicationException(response.StatusMessage + " Code: " + response.StatusCode);
}
}// v8 saw this with one record in testing update, assuming it's a glitch due to coding experimentation in the data
// StatusMessage "The query request has not been fully completed. There was a required element (\"190000-933272656\") that could not be found in QuickBooks." System.String
IItemInventoryRetList il = response.Detail as IItemInventoryRetList;
@@ -5069,8 +5071,8 @@ namespace AyaNovaQBI
ca.SalesPrice.SetValue((double)c.Retail);
ca.PurchaseCost.SetValue((double)c.Cost);
if (QVersion > 6.0)//new v8
ca.ManufacturerPartNumber.SetValue(T(31, c.ManufacturerNumber));
//if (QVersion > 6.0)//new v8
// ca.ManufacturerPartNumber.SetValue(T(31, c.ManufacturerNumber));
//Set the QB item identification and edit sequence
ca.ListID.SetValue(im.IntegrationItemId);
@@ -5085,7 +5087,7 @@ namespace AyaNovaQBI
IMsgSetResponse responseSet = sessionManager.DoRequests(requestSet);
// Uncomment the following to view and save the request and response XML
//// Uncomment the following to view and save the request and response XML
//string requestXML = requestSet.ToXMLString();
//MessageBox.Show(requestXML);
// SaveXML(requestXML);
@@ -5258,8 +5260,8 @@ namespace AyaNovaQBI
ca.SalesPrice.SetValue((double)c.Retail);
ca.PurchaseCost.SetValue((double)c.Cost);
if (QVersion > 6.0)//new v8
ca.ManufacturerPartNumber.SetValue(T(31, c.ManufacturerNumber));
//if (QVersion > 6.0)//new v8
// ca.ManufacturerPartNumber.SetValue(T(31, c.ManufacturerNumber));
if (USE_INVENTORY)