Esempio n. 1
0
        public async Task <byte[]> GetAsync(BillingJournalizingOption option, CancellationToken token = default(CancellationToken))
        {
            var companyTask = companyQueryProcessor.GetAsync(new CompanySearch {
                Id = option.CompanyId,
            }, token);
            var appConTask = applicationControlGetByCompanyQueryProcessor.GetAsync(option.CompanyId, token);
            var nameTask   = columnNameSettingQueryProcessor.GetAsync(new ColumnNameSetting {
                CompanyId = option.CompanyId, TableName = nameof(Receipt),
            }, token);
            var loadTask = billingJournalizingQueryProcessor.ExtractAsync(option, token);

            await Task.WhenAll(companyTask, appConTask, nameTask, loadTask);

            var company = companyTask.Result.First();
            var appCon  = appConTask.Result;
            var naming  = nameTask.Result.ToList();
            var items   = loadTask.Result.ToList();

            if (!items.Any())
            {
                return(null);
            }

            var report = new BillingJournalizingSectionReport();

            var reoutput = option.OutputAt?.Any() ?? false;
            var fileName = $"{(reoutput ? "再出力" : "")}請求仕訳{DateTime.Now:yyyyMMdd_HHmmss}";

            report.SetBasicPageSetting(company.Code, company.Name);
            report.Name = fileName;
            report.SetData(items, appCon.UseForeignCurrency == 1, option.Precision, naming);

            report.Run();

            return(report.Convert());
        }
Esempio n. 2
0
 public async Task <IEnumerable <BillingJournalizing> > ExtractAsync(BillingJournalizingOption option, CancellationToken token = default(CancellationToken))
 => await billingJournalizingQueryProcessor.ExtractAsync(option, token);