This commit is contained in:
2022-07-11 16:11:39 +00:00
parent 826acdd570
commit f98e0e7807
3 changed files with 52 additions and 93 deletions

View File

@@ -89,38 +89,9 @@ 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 async void fixProblemsToolStripMenuItem_Click(object sender, EventArgs e)
{
FixInvoiceProblems d = new FixInvoiceProblems();
d.MisMatches = _MisMatches;
d.PartPriceOverrides = _PartPriceOverrides;
d.ShowDialog();
if (d.ChangesMade)
await InitInvoices();
d.Dispose();
}
private async void refreshInvoicesToolStripMenuItem_Click(object sender, EventArgs e)
{
@@ -177,7 +148,48 @@ namespace AyaNovaQBI
b.Dispose();
}
#region Main workorder grid
#region WORKORDERS / INVOICING
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 async void fixProblemsToolStripMenuItem_Click(object sender, EventArgs e)
{
FixInvoiceProblems d = new FixInvoiceProblems();
d.MisMatches = _MisMatches;
d.PartPriceOverrides = _PartPriceOverrides;
d.ShowDialog();
if (d.ChangesMade)
await InitInvoices();
d.Dispose();
}
/// <summary>
/// Adjusts main form display to either show a list of billable workorders
@@ -278,6 +290,11 @@ namespace AyaNovaQBI
row["Linked"]= await util.ScanLinksOK(z.Id, _MisMatches, _PartPriceOverrides);
_GridTable.Rows.Add(row);
}
//var bindingList = new BindingList(_GridTable);
//var source = new BindingSource(bindingList, null);
//grid.DataSource = source;
grid.DataSource = _GridTable;
grid.ClearSelection();
}
@@ -290,67 +307,8 @@ namespace AyaNovaQBI
///// <summary>
///// Helper for grouping workorders by client
///// </summary>
///// <param name="ClientID"></param>
///// <returns>null if not found else datarow containing invoice for client</returns>
//private DataRow InvoiceRowForClientID(Guid ClientID)
//{
// foreach (DataRow r in dsInvoices.Tables["Invoices"].Rows)
// {
// if ((Guid)r["ClientID"] == ClientID)
// {
// return r;
// }
// }
// return null;
//}
//private void grid_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e)
//{
// if (e.Row.Band.Index == 0)
// {
// //Prepare invoice row
// if ((bool)e.Row.Cells["Linked"].Value == true)
// {
// e.Row.Cells["Client"].Appearance.Image = Util.AyaImage("OK16");//Util.Image("OK16.png");
// }
// else
// {
// e.Row.Cells["Client"].Appearance.Image = Util.AyaImage("Cancel16");//Util.Image("Cancel16.png");
// }
// }
// else
// {
// //prepare workorder row
// //if backcolor==0 that means no color was set
// int nColor = (int)e.Row.Cells["StatusARGB"].Value;
// if (nColor != 0)
// {
// e.Row.Cells["Status"].Appearance.BackColor = Color.FromArgb(nColor);
// e.Row.Cells["Status"].Appearance.ForeColor = Util.InvertColor(Color.FromArgb(nColor));
// }
// //flag whether billable (linked) or not
// if ((bool)e.Row.Cells["Linked"].Value == true)
// {
// e.Row.Cells["ServiceNumber"].Appearance.Image = Util.AyaImage("OK16");
// }
// else
// {
// e.Row.Cells["ServiceNumber"].Appearance.Image = Util.AyaImage("Cancel16");
// }
// }
//}
#endregion
#endregion workorders / invoicing