This commit is contained in:
2022-06-24 22:04:53 +00:00
parent 0b6ef95c66
commit e20591a4c9
4 changed files with 165 additions and 1 deletions

View File

@@ -93,6 +93,8 @@
<DependentUpon>MainForm.cs</DependentUpon> <DependentUpon>MainForm.cs</DependentUpon>
</Compile> </Compile>
<Compile Include="InvoiceableItem.cs" /> <Compile Include="InvoiceableItem.cs" />
<Compile Include="NameIdActiveChargeCostItem.cs" />
<Compile Include="NameIdActiveItem.cs" />
<Compile Include="NameIdItem.cs" /> <Compile Include="NameIdItem.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

View File

@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AyaNovaQBI
{
public class NameIdActiveChargeCostItem
{
public long Id { get; set; }
public string Name { get; set; }
public bool Active { get; set; }
public decimal Cost { get; set; }
public decimal Charge { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AyaNovaQBI
{
public class NameIdActiveItem
{
public long Id { get; set; }
public string Name { get; set; }
public bool Active { get; set; }
}
}

View File

@@ -563,7 +563,7 @@ namespace AyaNovaQBI
{ {
await IntegrationLog($"PFC: QB Company name= {QCompanyName}, QB Country version={QCountry}, QBVersion={QVersion}, Companyfile={QCompanyFile}"); await IntegrationLog($"PFC: QB Company name= {QCompanyName}, QB Country version={QCountry}, QBVersion={QVersion}, Companyfile={QCompanyFile}");
await PopulateQBListCache(); await PopulateQBListCache();
//PFC - PopulateAyaListCache() await PopulateAyaListCache();
//PFC - Validate settings, create if necessary (Util.ValidateSettings()) and save //PFC - Validate settings, create if necessary (Util.ValidateSettings()) and save
@@ -2448,6 +2448,134 @@ namespace AyaNovaQBI
#endregion #endregion
#region AyaNova cached lists
public async static Task PopulateAyaListCache()
{
//Get the cached QB data
Waiting w = new Waiting();
w.Show();
w.Ops = "Reading from AyaNova...";
w.Step = "Clients";
//todo: qBI requires id, name and active for matching only
await PopulateAyaClientList();
w.Step = "Vendors";
//TODO: QBI requires id, name and active status for vendors only, it used to need vendortype but they don't exist in v8, maybe tags sb fetched?
await PopulateAyaVendorList();
w.Step = "Rates";
await PopulateAyaServiceRateList();//todo: requires id, name, rate type (travel or service), charge amount, perhaps break into two??
w.Step = "Parts";
await PopulateAyaPartList();//todo: requires id, name, cost, retail/charge,
w.Close();
}
#region AyaNova clients
private static List<NameIdActiveItem> _clientlist = null;
/// <summary>
/// AyaNova ClientPickList
/// </summary>
public static List<NameIdActiveItem> AyaClientList
{
get
{
return _clientlist;
}
}
public static async Task PopulateAyaClientList()
{
_clientlist = ClientPickList.GetList();
}
#endregion ayanova clients
#region AyaNova Vendors
private static List<NameIdActiveItem> _vendorlist = null;
/// <summary>
/// AyaNova vendor list
/// </summary>
public static List<NameIdActiveItem> AyaVendorList
{
get
{
return _vendorlist;
}
}
public static async Task PopulateAyaVendorList()
{
_vendorlist = VendorPickList.GetList();
}
#endregion ayanova vendors
#region AyaNova Rates
private static List<NameIdActiveChargeCostItem> _ServiceRatelist = null;
/// <summary>
/// AyaNova service rate list
/// </summary>
public static List<NameIdActiveChargeCostItem> AyaServiceRateList
{
get
{
return _ServiceRatelist;
}
}
public static async Task PopulateAyaServiceRateList()
{
_ServiceRatelist = RatePickList.GetListAllActiveRates();
}
private static List<NameIdActiveChargeCostItem> _TravelRatelist = null;
/// <summary>
/// AyaNova Travel rate list
/// </summary>
public static List<NameIdActiveChargeCostItem> AyaTravelRateList
{
get
{
return _TravelRatelist;
}
}
public static async Task PopulateAyaTravelRateList()
{
_TravelRatelist = RatePickList.GetListAllActiveRates();
}
#endregion ayanova rates
#region AyaNova Parts
private static List<NameIdActiveChargeCostItem> _partlist = null;
/// <summary>
/// AyaNova part list
/// </summary>
public static List<NameIdActiveChargeCostItem> AyaPartList
{
get
{
return _partlist;
}
}
public static async Task PopulateAyaPartList()
{
_partlist = PartPickList.GetAllParts();
}
#endregion ayanova parts
#endregion
#endregion qb stuff #endregion qb stuff