This commit is contained in:
@@ -293,9 +293,6 @@ namespace AyaNovaQBI
|
||||
/// </summary>
|
||||
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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user