This commit is contained in:
2022-07-03 21:23:42 +00:00
parent 384a78535c
commit d1c4eb7cc8
2 changed files with 119 additions and 187 deletions

View File

@@ -36,7 +36,7 @@ namespace AyaNovaQBI
_aya = new DataTable("AyaNova");
_aya.Columns.Add("name", typeof(string));
_aya.Columns.Add("id", typeof(long));
_aya.Columns.Add("linked", typeof(bool));
_aya.Columns.Add("linked", typeof(string));
//Case 339
_aya.DefaultView.Sort = "name asc";
@@ -148,7 +148,7 @@ namespace AyaNovaQBI
else
{
//user is removing mapping so remove the integrationitem entirely from the collection
var didremove=util.QBIntegration.Items.Remove(m);
var didremove = util.QBIntegration.Items.Remove(m);
SaveIntegration = true;
}
@@ -226,44 +226,13 @@ namespace AyaNovaQBI
#region client
/*
foreach(ClientPickList.ClientPickListInfo i in Util.AyaClientList)
{
if(i.Active)
{
bool bLinked=Util.QBI.Maps.Contains(i.ID);
if(DisplayRow(bLinked))
_aya.Rows.Add(new object[] {i.ID,i.Name,bLinked});
}
}
//Fill QB table with QB Customers from prefetched table
foreach(DataRow dr in Util.QBClients.Rows)
{
bool bLinked=Util.QBI.Maps.Contains(dr["ID"].ToString(),RootObjectTypes.Client);
if(DisplayRow(bLinked))
_qb.Rows.Add(new object[] {dr["ID"].ToString(),dr["FullName"].ToString(),bLinked});
}
*/
foreach (var i in util.AyaClientList)
{
if (i.Active)
{
bool bLinked = util.QBIntegration.Items.Any(z => z.AType == _Type && z.ObjectId == i.Id);
if (DisplayRow(bLinked))
{
//var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id);
//if (qbItem == null)
//{
// qbItem = new IntegrationItem();
//}
_aya.Rows.Add(new object[] { i.Name, i.Id, bLinked });
}
var v = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.ObjectId == i.Id);
if (DisplayRow(v != null))
_aya.Rows.Add(new object[] { i.Name, i.Id, v == null ? null : v.IntegrationItemName });
}
}
@@ -284,13 +253,9 @@ namespace AyaNovaQBI
{
if (i.Active)
{
bool bLinked = util.QBIntegration.Items.Any(z => z.AType == _Type && z.ObjectId == i.Id);
if (DisplayRow(bLinked))
{
//var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id);
_aya.Rows.Add(new object[] { i.Name, i.Id, bLinked });
}
var v = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.ObjectId == i.Id);
if (DisplayRow(v != null))
_aya.Rows.Add(new object[] { i.Name, i.Id, v == null ? null : v.IntegrationItemName });
}
}
@@ -312,23 +277,9 @@ namespace AyaNovaQBI
{
if (i.Active)
{
// //Determine the most likely description for purposes
// //of importing a rate from QB later by picking the first one
// //in the existing rate list that is non-empty
// //typically this will just be hours and every rate will
// //probably use the same one or for travel "miles" or "km's" etc
// if(_MostLikelyRateUnitChargeDescriptionID==Guid.Empty && i.RateUnitChargeDescriptionID!=Guid.Empty)
// _MostLikelyRateUnitChargeDescriptionID=i.RateUnitChargeDescriptionID;
//After discussion we decided to not us any rate unit charge description
//so leaving the code in but defaulted to guid.empty for now.
bool bLinked = util.QBIntegration.Items.Any(z => z.AType == _Type && z.ObjectId == i.Id);
if (DisplayRow(bLinked))
{
// var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id);
_aya.Rows.Add(new object[] { i.Name, i.Id, bLinked });
}
var v = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.ObjectId == i.Id);
if (DisplayRow(v != null))
_aya.Rows.Add(new object[] { i.Name, i.Id, v == null ? null : v.IntegrationItemName });
}
}
@@ -355,24 +306,9 @@ namespace AyaNovaQBI
{
if (i.Active)
{
// //Determine the most likely description for purposes
// //of importing a rate from QB later by picking the first one
// //in the existing rate list that is non-empty
// //typically this will just be hours and every rate will
// //probably use the same one or for travel "miles" or "km's" etc
// if(_MostLikelyRateUnitChargeDescriptionID==Guid.Empty && i.RateUnitChargeDescriptionID!=Guid.Empty)
// _MostLikelyRateUnitChargeDescriptionID=i.RateUnitChargeDescriptionID;
//After discussion we decided to not us any rate unit charge description
//so leaving the code in but defaulted to guid.empty for now.
bool bLinked = util.QBIntegration.Items.Any(z => z.AType == _Type && z.ObjectId == i.Id);
if (DisplayRow(bLinked))
{
// var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id);
_aya.Rows.Add(new object[] { i.Name, i.Id, bLinked });
}
var v = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.ObjectId == i.Id);
if (DisplayRow(v != null))
_aya.Rows.Add(new object[] { i.Name, i.Id, v == null ? null : v.IntegrationItemName });
}
}
@@ -401,14 +337,9 @@ namespace AyaNovaQBI
{
if (i.Active)
{
bool bLinked = util.QBIntegration.Items.Any(z => z.AType == _Type && z.ObjectId == i.Id);
if (DisplayRow(bLinked))
{
//var qbItem = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.Id == i.Id);
_aya.Rows.Add(new object[] { i.Name, i.Id, bLinked });
}
var v = util.QBIntegration.Items.FirstOrDefault(z => z.AType == _Type && z.ObjectId == i.Id);
if (DisplayRow(v != null))
_aya.Rows.Add(new object[] { i.Name, i.Id, v == null ? null : v.IntegrationItemName });
}
}