public async Task <ActionResult <IEnumerable <Receipt> > > SearchReceiptData(MatchingReceiptSearch option, CancellationToken token) { List <Receipt> result = null; option.Orders = (await collationSettingProcessor .GetMatchingReceiptOrderAsync(option.CompanyId, token)) .Where(x => (x.Available == 1)).ToArray(); if (!option.MatchingHeaderId.HasValue) { result = (await matchingProcessor.SearchReceiptDataAsync(option, token)).ToList(); } else { result = (await matchingProcessor.GetMatchedReceiptsAsync(option, token)).ToList(); } return(result); }
public async Task<ReceiptsResult> SearchReceiptDataAsync(string SessionKey, MatchingReceiptSearch MatchingReceiptSearch) { return await authorizationProcessor.DoAuthorizeAsync(SessionKey, async token => { List<Receipt> result = null; MatchingReceiptSearch.Orders = (await collationSettingProcessor .GetMatchingReceiptOrderAsync(MatchingReceiptSearch.CompanyId, token)) .Where(x => (x.Available == 1)).ToArray(); if (!MatchingReceiptSearch.MatchingHeaderId.HasValue) { result = (await matchingProcessor.SearchReceiptDataAsync(MatchingReceiptSearch, token)).ToList(); } else { result = (await matchingProcessor.GetMatchedReceiptsAsync(MatchingReceiptSearch, token)).ToList(); } return new ReceiptsResult { ProcessResult = new ProcessResult { Result = true }, Receipts = result, }; }, logger); }