This commit is contained in:
3
AyaNovaQBI/MainForm.Designer.cs
generated
3
AyaNovaQBI/MainForm.Designer.cs
generated
@@ -243,7 +243,6 @@
|
||||
this.customer.HeaderText = "Customer";
|
||||
this.customer.Name = "customer";
|
||||
this.customer.ReadOnly = true;
|
||||
this.customer.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
//
|
||||
// wonumber
|
||||
//
|
||||
@@ -251,7 +250,6 @@
|
||||
this.wonumber.HeaderText = "Service number";
|
||||
this.wonumber.Name = "wonumber";
|
||||
this.wonumber.ReadOnly = true;
|
||||
this.wonumber.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
//
|
||||
// ProjectName
|
||||
//
|
||||
@@ -273,7 +271,6 @@
|
||||
this.status.HeaderText = "Status";
|
||||
this.status.Name = "status";
|
||||
this.status.ReadOnly = true;
|
||||
this.status.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
|
||||
//
|
||||
// statuscolor
|
||||
//
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
@@ -388,7 +389,8 @@ namespace AyaNovaQBI
|
||||
|
||||
*/
|
||||
|
||||
private List<WorkOrderGridListItem> _WorkOrderGridListItems = new List<WorkOrderGridListItem>();
|
||||
//private BindingList<WorkOrderGridListItem> _WorkOrderGridListItems = new BindingList<WorkOrderGridListItem>();
|
||||
private DataTable _GridTable = null;
|
||||
private List<util.MisMatch> _MisMatches = new List<util.MisMatch>();
|
||||
private List<long> _PartPriceOverrides = new List<long>();
|
||||
/// <summary>
|
||||
@@ -404,42 +406,78 @@ namespace AyaNovaQBI
|
||||
w.Ops = "Validating invoices...";
|
||||
try
|
||||
{
|
||||
if (_GridTable == null)
|
||||
{
|
||||
//datatable is required to support sorting in dgv without writing a lot of extra code
|
||||
_GridTable = new DataTable();
|
||||
_GridTable.Columns.Add(new DataColumn("CustomerName"));
|
||||
_GridTable.Columns.Add(new DataColumn("Serial"));
|
||||
_GridTable.Columns.Add(new DataColumn("ServiceDate"));
|
||||
_GridTable.Columns.Add(new DataColumn("WorkorderStatusName"));
|
||||
_GridTable.Columns.Add(new DataColumn("ProjectName"));
|
||||
_GridTable.Columns.Add(new DataColumn("Color"));
|
||||
_GridTable.Columns.Add(new DataColumn("CustomerId"));
|
||||
_GridTable.Columns.Add(new DataColumn("Id"));
|
||||
_GridTable.Columns.Add(new DataColumn("Linked"));
|
||||
}
|
||||
_MisMatches.Clear();
|
||||
|
||||
//[HttpGet("accounting-list-billable/{workOrderStatusId}")]
|
||||
var r = await util.GetAsync($"workorder/accounting-list-billable/{util.QDat.PreWOStatus}");
|
||||
var v = r.ObjectResponse["data"]
|
||||
.ToObject<List<WorkOrderAccountingListItem>>();
|
||||
_WorkOrderGridListItems = v
|
||||
.Select(z => new WorkOrderGridListItem
|
||||
var v = r.ObjectResponse["data"].ToObject<List<WorkOrderAccountingListItem>>();
|
||||
|
||||
foreach (WorkOrderAccountingListItem z in v)
|
||||
{
|
||||
Color = z.color,
|
||||
CustomerId = z.customerId,
|
||||
CustomerName = z.customerName,
|
||||
Id = z.id,
|
||||
ProjectName = z.projectName,
|
||||
Serial = z.serial,
|
||||
ServiceDate = z.serviceDate,
|
||||
WorkorderStatusName = z.workorderStatusName
|
||||
})
|
||||
.ToList();
|
||||
w.Step = "WO: " + z.Serial;
|
||||
DataRow row = _GridTable.NewRow();
|
||||
row["CustomerName"] = z.CustomerName;
|
||||
row["Serial"] = z.Serial;
|
||||
row["ServiceDate"] = z.ServiceDate;
|
||||
row["WorkorderStatusName"] = z.WorkorderStatusName;
|
||||
row["ProjectName"] = z.ProjectName;
|
||||
row["Color"] = z.Color;
|
||||
row["CustomerId"] = z.CustomerId;
|
||||
row["Id"] = z.Id;
|
||||
row["Linked"]= util.ScanLinksOK(z.Id, _MisMatches, _PartPriceOverrides);
|
||||
|
||||
|
||||
|
||||
foreach (WorkOrderGridListItem i in _WorkOrderGridListItems)
|
||||
{
|
||||
w.Step = "WO: " + i.Serial;
|
||||
i.Linked = util.ScanLinksOK(i.Id, _MisMatches, _PartPriceOverrides);
|
||||
//DataRow dri = InvoiceRowForClientID(i.ClientID);
|
||||
|
||||
//if (dri == null)
|
||||
//{
|
||||
// dri = dtInvoice.NewRow();
|
||||
// dri["Client"] = i.Client;
|
||||
// dri["ClientID"] = i.ClientID;
|
||||
// dtInvoice.Rows.Add(dri);
|
||||
_GridTable.Rows.Add(row);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//foreach (WorkOrderAccountingListItem z in v)
|
||||
//{
|
||||
// _WorkOrderGridListItems.Add(new WorkOrderGridListItem
|
||||
// {
|
||||
// Color = z.Color,
|
||||
// CustomerId = z.CustomerId,
|
||||
// CustomerName = z.CustomerName,
|
||||
// Id = z.Id,
|
||||
// ProjectName = z.ProjectName,
|
||||
// Serial = z.Serial,
|
||||
// ServiceDate = z.ServiceDate,
|
||||
// WorkorderStatusName = z.WorkorderStatusName
|
||||
// });
|
||||
//}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//foreach (WorkOrderGridListItem i in _WorkOrderGridListItems)
|
||||
//{
|
||||
// w.Step = "WO: " + i.Serial;
|
||||
// i.Linked = util.ScanLinksOK(i.Id, _MisMatches, _PartPriceOverrides);
|
||||
// //DataRow dri = InvoiceRowForClientID(i.ClientID);
|
||||
|
||||
// //if (dri == null)
|
||||
// //{
|
||||
// // dri = dtInvoice.NewRow();
|
||||
// // dri["Client"] = i.Client;
|
||||
// // dri["ClientID"] = i.ClientID;
|
||||
// // dtInvoice.Rows.Add(dri);
|
||||
//}
|
||||
|
||||
//If any one single workorder is linked
|
||||
//then the invoice is flagged as linked because
|
||||
//you can invoice out anything under it that is linked and the
|
||||
@@ -509,7 +547,8 @@ namespace AyaNovaQBI
|
||||
|
||||
private void InitializeGrid()
|
||||
{
|
||||
grid.DataSource = _WorkOrderGridListItems;
|
||||
|
||||
grid.DataSource = _GridTable;
|
||||
//grid.Columns["WorkingID"].Visible = false;
|
||||
//grid.Columns["ClientID"].Visible = false;
|
||||
//grid.Columns["Linked"].Visible = false;
|
||||
|
||||
@@ -8,13 +8,13 @@ namespace AyaNovaQBI
|
||||
/// </summary>
|
||||
public class WorkOrderAccountingListItem
|
||||
{
|
||||
public long id { get; set; }
|
||||
public long customerId { get; set; }
|
||||
public string customerName { get; set; }
|
||||
public string workorderStatusName { get; set; }
|
||||
public long serial { get; set; }
|
||||
public DateTime? serviceDate { get; set; }
|
||||
public string color { get; set; }
|
||||
public string projectName { get; set; }
|
||||
public long Id { get; set; }
|
||||
public long CustomerId { get; set; }
|
||||
public string CustomerName { get; set; }
|
||||
public string WorkorderStatusName { get; set; }
|
||||
public long Serial { get; set; }
|
||||
public DateTime? ServiceDate { get; set; }
|
||||
public string Color { get; set; }
|
||||
public string ProjectName { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user