This commit is contained in:
2022-06-18 22:48:40 +00:00
parent 38214e8c5e
commit 104cddc35d
3 changed files with 63 additions and 1 deletions

View File

@@ -99,24 +99,28 @@
this.multipleWorkordersPerInvoiceToolStripMenuItem.Name = "multipleWorkordersPerInvoiceToolStripMenuItem";
this.multipleWorkordersPerInvoiceToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
this.multipleWorkordersPerInvoiceToolStripMenuItem.Text = "&Multiple workorders per invoice";
this.multipleWorkordersPerInvoiceToolStripMenuItem.Click += new System.EventHandler(this.multipleWorkordersPerInvoiceToolStripMenuItem_Click);
//
// oneWorkOrderPerInvoiceToolStripMenuItem
//
this.oneWorkOrderPerInvoiceToolStripMenuItem.Name = "oneWorkOrderPerInvoiceToolStripMenuItem";
this.oneWorkOrderPerInvoiceToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
this.oneWorkOrderPerInvoiceToolStripMenuItem.Text = "&One work order per invoice";
this.oneWorkOrderPerInvoiceToolStripMenuItem.Click += new System.EventHandler(this.oneWorkOrderPerInvoiceToolStripMenuItem_Click);
//
// fixProblemsToolStripMenuItem
//
this.fixProblemsToolStripMenuItem.Name = "fixProblemsToolStripMenuItem";
this.fixProblemsToolStripMenuItem.Size = new System.Drawing.Size(279, 22);
this.fixProblemsToolStripMenuItem.Text = "&Fix problems";
this.fixProblemsToolStripMenuItem.Click += new System.EventHandler(this.fixProblemsToolStripMenuItem_Click);
//
// refreshInvoicesToolStripMenuItem
//
this.refreshInvoicesToolStripMenuItem.Name = "refreshInvoicesToolStripMenuItem";
this.refreshInvoicesToolStripMenuItem.Size = new System.Drawing.Size(279, 22);
this.refreshInvoicesToolStripMenuItem.Text = "&Refresh invoices";
this.refreshInvoicesToolStripMenuItem.Click += new System.EventHandler(this.refreshInvoicesToolStripMenuItem_Click);
//
// toolsToolStripMenuItem
//

View File

@@ -20,6 +20,8 @@ namespace AyaNovaQBI
private void MainForm_Load(object sender, EventArgs e)
{
//Initialize
grid.DataSource = util.GetInvoiceableItems();
}
@@ -47,6 +49,36 @@ namespace AyaNovaQBI
Close();
}
private void multipleWorkordersPerInvoiceToolStripMenuItem_Click(object sender, EventArgs e)
{
if (grid.SelectedRows.Count < 1)
{
MessageBox.Show("There are no rows selected, select one or more rows to invoice");
return;
}
MessageBox.Show($"STUB: MULTIPLEwoperinvoice {grid.SelectedRows.Count} rows selected");
}
private void oneWorkOrderPerInvoiceToolStripMenuItem_Click(object sender, EventArgs e)
{
if (grid.SelectedRows.Count < 1)
{
MessageBox.Show("There are no rows selected, select one or more rows to invoice");
return;
}
MessageBox.Show($"STUB: onwoperinvoice {grid.SelectedRows.Count} rows selected");
}
private void fixProblemsToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("STUB: FIX PROBLEMS");
}
private void refreshInvoicesToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("STUB: REFRESH INVOICES");
}
}
}

View File

@@ -24,5 +24,31 @@ namespace AyaNovaQBI
}
public static bool InitializeQBI()
{
//COPY most of this code from qbi v7 becuase it has a lot of edge cases in it and it's complex and thorough, but break it into abstracted bits so can be replicated in other accounting add-on's more easily
//This is pre-pfc block of stuff that doesn't map well from v7 qbi plugin to here so replicate it in spirit here but not much is copyable just the concepts
//Fetch AyaNova license
//Check if licensed
//check if build date is within licensed date (how did I do that automated build date thing?)
//check that AyaNova version matches required minimum for this QBI (
//PFC - Util.QBValidate stuff:
//Validate QB connection can be made and open connection and start session with QB (see Util.QBValidate in v7
//once connected collect the country, version we are dealing with (Util.qbValidate)
//confirm qb is 2008 or newer and bail if not (util.qbvalidate)
//cache company name and other qb info
//PFC - PopulateQBListCache()
//PFC - PopulateAyaListCache()
//PFC - integration object check (fetch or create if not present) (Util.integrationObjectCheck())
//PFC - Validate settings, create if necessary (Util.ValidateSettings()) and save
//PFC - verify integration mapped objects still exist at each end (Util.PreFlightCheck() line 199)
//DONE
}
}
}