public IActionResult SalesReceipt(int id) { var salesReceipt = _salesService.GetSalesReceiptById(id); var salesReceiptDto = new Dto.Sales.SalesReceipt() { Id = salesReceipt.Id, ReceiptNo = salesReceipt.No, CustomerId = salesReceipt.CustomerId, CustomerName = salesReceipt.Customer.Party.Name, ReceiptDate = salesReceipt.Date, Amount = salesReceipt.Amount, RemainingAmountToAllocate = salesReceipt.AvailableAmountToAllocate }; return(new ObjectResult(salesReceiptDto)); }
public IActionResult SalesReceipts() { var salesReceipts = _salesService.GetSalesReceipts(); IList <Dto.Sales.SalesReceipt> salesReceiptsDto = new List <Dto.Sales.SalesReceipt>(); foreach (var salesReceipt in salesReceipts) { var salesReceiptDto = new Dto.Sales.SalesReceipt() { Id = salesReceipt.Id, ReceiptNo = salesReceipt.No, CustomerId = salesReceipt.CustomerId, CustomerName = salesReceipt.Customer.Party.Name, ReceiptDate = salesReceipt.Date, Amount = salesReceipt.Amount, RemainingAmountToAllocate = salesReceipt.AvailableAmountToAllocate }; salesReceiptsDto.Add(salesReceiptDto); } return(new ObjectResult(salesReceiptsDto)); }