From 42c055592328eb4e60d5c605c3c08ce64300a7fe Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 12 Jul 2022 21:23:19 +0000 Subject: [PATCH] --- AyaNovaQBI/MainForm.cs | 78 +++--------------------------------------- 1 file changed, 4 insertions(+), 74 deletions(-) diff --git a/AyaNovaQBI/MainForm.cs b/AyaNovaQBI/MainForm.cs index a4afa82..8296005 100644 --- a/AyaNovaQBI/MainForm.cs +++ b/AyaNovaQBI/MainForm.cs @@ -293,9 +293,6 @@ namespace AyaNovaQBI /// private async Task InvoiceSelected(bool bOneWoPerInvoice) { - - - if (grid.SelectedRows.Count < 1) { MessageBox.Show("There are no Work order rows selected\r\nSelect one or more rows to invoice"); @@ -320,6 +317,10 @@ namespace AyaNovaQBI return; } + if (MessageBox.Show("Invoice the selected AyaNova Work orders into QuickBooks.\r\n\r\nAre you sure?", "Invoice AyaNova Work orders", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No) + return; + + //We now have a list of work orders from grid selections ready to be invoiced and ordered by customer for grouping purposes //An array list to hold the guid's of workorders being invoiced @@ -356,70 +357,6 @@ namespace AyaNovaQBI al.Clear(); } } - - //long currentCustomerId = -1; - //int CountOfInvoiceableWorkOrders = InvoiceableWorkOrdersList.Count; - //for (int i = 0; i < CountOfInvoiceableWorkOrders; i++) - //{ - // bool finalRecord = CountOfInvoiceableWorkOrders - 1 == i; - // WorkOrderAccountingListItem invwo = InvoiceableWorkOrdersList[i]; - // if (bOneWoPerInvoice) - // { - // al.Add(invwo.Id); - // w.Step = "Invoicing single workorder "; - // await util.Invoice(al, alErrors); - // //and clear al workorders list - // al.Clear(); - // } - // else - // { - // //change of customer or last one in loop? - // if ((finalRecord || invwo.CustomerId != currentCustomerId) && al.Count > 0) - // { - // //invoice out this batch - // w.Step = "Batch invoicing " + al.Count.ToString() + ((al.Count > 1) ? " Work Orders" : " Work Order"); - // await util.Invoice(al, alErrors); - // al.Clear(); - // } - // currentCustomerId = invwo.CustomerId; - // al.Add(invwo.Id); - - // } - //} - - - ////work through selected items top to bottom - //foreach (DataGridViewRow r in grid.SelectedRows) - //{ - // //clear the workorder list - // al.Clear(); - - - // if ((bool)r.Cells["Linked"].Value == true) - // { - // al.Add((long)r.Cells["id"].Value); - // //case 1604 - // if (bOneWoPerInvoice) - // { - // //then invoice it out now - // w.Step = "Invoicing single workorder "; - // await util.Invoice(al, alErrors); - // //and clear al workorders list - // al.Clear(); - // } - - // } - - - - - - - //}//end of foreach loop - //{ - // w.Step = "Invoicing " + al.Count.ToString() + ((al.Count > 1) ? " Workorders" : " Workorder"); - // await util.Invoice(al, alErrors); - //} w.Close(); //display errors if any @@ -432,20 +369,13 @@ namespace AyaNovaQBI { sb.Append((string)o); sb.Append("\r\n************\r\n"); - } - CopyableMessageBox cb = new CopyableMessageBox(sb.ToString()); cb.ShowDialog(); - - } - //refresh display await InitInvoices(); } - - #endregion workorders / invoicing