This commit is contained in:
@@ -177,6 +177,27 @@ namespace AyaNova.Api.Controllers
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get list for accounting integrations
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>NameIdActive list</returns>
|
||||||
|
[HttpGet("accounting-list")]
|
||||||
|
public async Task<IActionResult> GetAccountingList()
|
||||||
|
{
|
||||||
|
if (!serverState.IsOpen)
|
||||||
|
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
CustomerBiz biz = CustomerBiz.GetBiz(ct, HttpContext);
|
||||||
|
if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
|
||||||
|
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||||
|
if (!ModelState.IsValid)
|
||||||
|
return BadRequest(new ApiErrorResponse(ModelState));
|
||||||
|
var o = await biz.GetNameIdActiveItemsAsync();
|
||||||
|
if (o == null) return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||||
|
return Ok(ApiOkResponse.Response(o));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// /// <summary>
|
// /// <summary>
|
||||||
// /// Get service (physical) address for this customer
|
// /// Get service (physical) address for this customer
|
||||||
// /// </summary>
|
// /// </summary>
|
||||||
|
|||||||
@@ -168,6 +168,26 @@ namespace AyaNova.Api.Controllers
|
|||||||
return Ok(ApiOkResponse.Response(await ct.Vendor.AsNoTracking().Where(x => x.Id == id).Select(x => x.AlertNotes).FirstOrDefaultAsync()));
|
return Ok(ApiOkResponse.Response(await ct.Vendor.AsNoTracking().Where(x => x.Id == id).Select(x => x.AlertNotes).FirstOrDefaultAsync()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Get list for accounting integrations
|
||||||
|
/// </summary>
|
||||||
|
/// <returns>NameIdActive list</returns>
|
||||||
|
[HttpGet("accounting-list")]
|
||||||
|
public async Task<IActionResult> GetAccountingList()
|
||||||
|
{
|
||||||
|
if (!serverState.IsOpen)
|
||||||
|
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
|
||||||
|
VendorBiz biz = VendorBiz.GetBiz(ct, HttpContext);
|
||||||
|
if (!Authorized.HasReadFullRole(HttpContext.Items, biz.BizType))
|
||||||
|
return StatusCode(403, new ApiNotAuthorizedResponse());
|
||||||
|
if (!ModelState.IsValid)
|
||||||
|
return BadRequest(new ApiErrorResponse(ModelState));
|
||||||
|
var o = await biz.GetNameIdActiveItemsAsync();
|
||||||
|
if (o == null) return NotFound(new ApiErrorResponse(ApiErrorCode.NOT_FOUND));
|
||||||
|
return Ok(ApiOkResponse.Response(o));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//------------
|
//------------
|
||||||
|
|
||||||
|
|||||||
@@ -193,6 +193,15 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//GET LIST FOR QBI MAPPING
|
||||||
|
//
|
||||||
|
internal async Task<List<NameIdActiveItem>> GetNameIdActiveItemsAsync()
|
||||||
|
{
|
||||||
|
return await ct.Customer.AsNoTracking().OrderBy(x => x.Name).Select(x => new NameIdActiveItem { Name = x.Name, Id = x.Id, Active = x.Active }).ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
//SEARCH
|
//SEARCH
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -77,17 +77,17 @@ namespace AyaNova.Biz
|
|||||||
//
|
//
|
||||||
internal async Task<List<NameIdActiveChargeCostItem>> GetNameIdActiveChargeCostItemsAsync()
|
internal async Task<List<NameIdActiveChargeCostItem>> GetNameIdActiveChargeCostItemsAsync()
|
||||||
{
|
{
|
||||||
var pList = await ct.Part.AsNoTracking().Select(x => new NameIdActiveChargeCostItem {Name=null, Id = x.Id, Active = x.Active, Cost = x.Cost, Charge = x.Retail }).ToListAsync();
|
var pList = await ct.Part.AsNoTracking().OrderBy(z=>z.Name).Select(x => new NameIdActiveChargeCostItem {Name=x.Name, Id = x.Id, Active = x.Active, Cost = x.Cost, Charge = x.Retail }).ToListAsync();
|
||||||
|
|
||||||
long[] partIdList = new long[0];
|
// long[] partIdList = new long[0];
|
||||||
var PickList = AyaNova.PickList.PickListFactory.GetAyaPickList(AyaType.Part);
|
// var PickList = AyaNova.PickList.PickListFactory.GetAyaPickList(AyaType.Part);
|
||||||
var partNames = await AyaNova.PickList.PickListFetcher.GetResponseAsync(PickList, null, null, true, partIdList, null, ct, null, string.Empty);
|
// var partNames = await AyaNova.PickList.PickListFetcher.GetResponseAsync(PickList, null, null, true, partIdList, null, ct, null, string.Empty);
|
||||||
foreach (var item in pList)
|
// foreach (var item in pList)
|
||||||
{
|
// {
|
||||||
item.Name = partNames.Where(z => z.Id == item.Id).First().Name;
|
// item.Name = partNames.Where(z => z.Id == item.Id).First().Name;
|
||||||
}
|
// }
|
||||||
//sort in place by name
|
// //sort in place by name
|
||||||
pList.Sort((lhs, rhs) => lhs.Name.CompareTo(rhs.Name));
|
// pList.Sort((lhs, rhs) => lhs.Name.CompareTo(rhs.Name));
|
||||||
|
|
||||||
return pList;
|
return pList;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ namespace AyaNova.Biz
|
|||||||
//
|
//
|
||||||
internal async Task<List<NameIdActiveChargeCostItem>> GetNameIdActiveChargeCostItemsAsync()
|
internal async Task<List<NameIdActiveChargeCostItem>> GetNameIdActiveChargeCostItemsAsync()
|
||||||
{
|
{
|
||||||
return await ct.ServiceRate.AsNoTracking().Select(x => new NameIdActiveChargeCostItem { Name = x.Name, Id = x.Id, Active = x.Active, Cost = x.Cost, Charge = x.Charge }).OrderBy(x => x.Name).ToListAsync();
|
return await ct.ServiceRate.AsNoTracking().OrderBy(x => x.Name).Select(x => new NameIdActiveChargeCostItem { Name = x.Name, Id = x.Id, Active = x.Active, Cost = x.Cost, Charge = x.Charge }).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -201,7 +201,7 @@ namespace AyaNova.Biz
|
|||||||
//
|
//
|
||||||
internal async Task<List<NameIdActiveChargeCostItem>> GetNameIdActiveChargeCostItemsAsync()
|
internal async Task<List<NameIdActiveChargeCostItem>> GetNameIdActiveChargeCostItemsAsync()
|
||||||
{
|
{
|
||||||
return await ct.TravelRate.AsNoTracking().Select(x => new NameIdActiveChargeCostItem { Name = x.Name, Id = x.Id, Active = x.Active, Cost = x.Cost, Charge = x.Charge }).OrderBy(x => x.Name).ToListAsync();
|
return await ct.TravelRate.AsNoTracking().OrderBy(x => x.Name).Select(x => new NameIdActiveChargeCostItem { Name = x.Name, Id = x.Id, Active = x.Active, Cost = x.Cost, Charge = x.Charge }).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -186,6 +186,13 @@ namespace AyaNova.Biz
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//GET LIST FOR QBI MAPPING
|
||||||
|
//
|
||||||
|
internal async Task<List<NameIdActiveItem>> GetNameIdActiveItemsAsync()
|
||||||
|
{
|
||||||
|
return await ct.Vendor.AsNoTracking().OrderBy(x => x.Name).Select(x => new NameIdActiveItem { Name = x.Name, Id = x.Id, Active = x.Active }).ToListAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user