public async Task <byte[]> GetAsync(int companyId, CancellationToken token = default(CancellationToken)) { var report = new SectionMasterReport(); return((await report.BuildAsync("入金部門マスター" + DateTime.Today.ToString("yyyyMMdd"), companyQueryProcessor.GetAsync(new CompanySearch { Id = companyId }, token), sectionQueryProcessor.GetAsync(new SectionSearch { CompanyId = companyId, }, token)))?.Convert()); }
public async Task <IEnumerable <ReceiptApportion> > GetAsync(IEnumerable <long> ids, CancellationToken token = default(CancellationToken)) { var entities = (await receiptApportionQueryProcessor.GetApportionItemsAsync(ids, token)).ToArray(); if (entities.Any(x => x.Apportioned == 0)) { var companyId = entities.First().CompanyId; var app = await applicationControlGetByCompanyQueryProcessor.GetAsync(companyId, token); var collation = await collationSettingGetByCompanyQueryProcessor.GetAsync(companyId, token); foreach (var receipt in entities.Where(x => x.Apportioned == 0)) { var customerId = receipt.CustomerId ?? receipt.RefCustomerId; if (app?.UseReceiptSection == 1 && !receipt.SectionId.HasValue && customerId.HasValue) { var section = (await sectionQueryProcessor.GetAsync(new SectionSearch { CustomerId = customerId.Value, })).FirstOrDefault(); if (section != null) { receipt.SectionId = section.Id; receipt.SectionCode = section.Code; receipt.SectionName = section.Name; } } if (collation?.AutoAssignCustomer == 1 && !receipt.CustomerId.HasValue && customerId.HasValue) { receipt.CustomerId = receipt.RefCustomerId; receipt.CustomerCode = receipt.RefCustomerCode; receipt.CustomerName = receipt.RefCustomerName; } if (collation?.UseApportionMenu == 1 && receipt.ExcludeFlag == 0 && !receipt.ExcludeCategoryId.HasValue) { var ignoreKana = (await ignoreKanaByCodeQueryProcessor.GetAsync(new IgnoreKana { CompanyId = companyId, Kana = receipt.PayerNameRaw, }, token)).FirstOrDefault(); if (ignoreKana != null) { receipt.ExcludeFlag = 1; receipt.ExcludeCategoryId = ignoreKana.ExcludeCategoryId; receipt.ExcludeAmount = receipt.ReceiptAmount; } } } } return(entities); }
public async Task <IEnumerable <Section> > GetAsync(SectionSearch option, CancellationToken token = default(CancellationToken)) => await sectionQueryProcessor.GetAsync(option, token);