Warehouses #1

Merged
trent merged 159 commits from Warehouses into master 2026-01-10 20:24:17 +00:00
3 changed files with 15 additions and 0 deletions
Showing only changes of commit e9a3e91082 - Show all commits

View File

@@ -55,6 +55,13 @@ namespace FaKrosnoApi.Controllers
await service.GetByCustomerAndPo(customerNumber, customerSequence, poNumber);
return customerOrder != null ? Ok(customerOrder) : NotFound();
}
[HttpGet("by-po")]
public async Task<ActionResult<CustomerOrderDto?>> GetByPo([FromQuery] string poNumber)
{
CustomerOrderDto? customerOrder = await service.GetByPo(poNumber);
return customerOrder != null ? Ok(customerOrder) : NotFound();
}
[HttpGet("list-by-customer-and-po")]
public async Task<ActionResult<IList<CustomerOrderDto?>>> GetListByCustomerAndPo(

View File

@@ -72,6 +72,13 @@ namespace SytelineSaAppEfDataModel.Services
.Where(x => x.CustNum == customerNumber && x.CustSeq == customerSequence && x.CustPo == poNumber)
.Select(x => mapper.Map<CustomerOrderDto>(x)).FirstOrDefaultAsync();
}
public async Task<CustomerOrderDto?> GetByPo(string poNumber)
{
return await context.CustomerOrders.Where(x => x.CustPo == poNumber && x.Stat == "O")
.OrderByDescending(x => x.CreateDate).Select(x => mapper.Map<CustomerOrderDto>(x))
.FirstOrDefaultAsync();
}
public async Task<IList<CustomerOrderDto>> GetListByCustomerAndPo(string customerNumber, int customerSequence,
string poNumber)

View File

@@ -17,6 +17,7 @@ namespace SytelineSaAppEfDataModel.Services
Task<IList<CustomerOrderDto>> GetListByCustomerAndPo(string customerNumber, int customerSequence,
string poNumber);
Task<CustomerOrderDto?> GetByPo(string poNumber);
Task<List<CustomerOrderDto>> GetListByCustomer(string customerNumber, int customerSequence);
Task<IEnumerable<CustomerOrderLineDto>?> GetLinesByCoNumber(string customerOrderNumber);
Task<IEnumerable<CustomerOrderLineItemDto>?> GetItemsByCoNumber(string customerOrderNumber);