async private Task <DebtorCollectionReportClient> GenerateStandardCollectionReport(CompanyClient companyClient, DateTime dueDate, DebtorPaymentStatementList selectedItem, byte[] logo, DebtorEmailType debtorEmailType) { var dbClientTotal = selectedItem.ChildRecords.FirstOrDefault(); var debtorType = Uniconta.Reports.Utilities.ReportUtil.GetUserType(typeof(DebtorClient), api.CompanyEntity); var debtorClient = Activator.CreateInstance(debtorType) as DebtorClient; StreamingManager.Copy(dbClientTotal.Debtor, debtorClient); var lan = UtilDisplay.GetLanguage(debtorClient, companyClient); if (lastMessage == null || messageLanguage != lan) { messageLanguage = lan; var res = await Utility.GetDebtorMessageClient(api, lan, debtorEmailType); if (res != null) { lastMessage = res._Text; } else { lastMessage = string.Empty; } } debtorClient.OpenTransactions = selectedItem.ChildRecords.ToArray(); string _reportName = StandardReportUtility.GetLocalizedReportName(debtorClient, companyClient, debtorEmailType.ToString()); return(new DebtorCollectionReportClient(companyClient, debtorClient, dueDate, logo, this.AddInterest, _reportName, lastMessage)); }
async private Task <DebtorCollectionReportClient> GenerateStandardCollectionReport(CompanyClient companyClient, DateTime dueDate, DebtorPaymentStatementList selectedItem, byte[] logo, DebtorEmailType debtorEmailType) { DebtorCollectionReportClient debtorCollectionReportClient = null; var dbClientTotal = selectedItem.ChildRecords.FirstOrDefault(); var debtorType = Uniconta.Reports.Utilities.ReportUtil.GetUserType(typeof(DebtorClient), api.CompanyEntity); var debtorClient = Activator.CreateInstance(debtorType) as DebtorClient; StreamingManager.Copy(dbClientTotal.Debtor, debtorClient); var debtorMessageClient = await Utility.GetDebtorMessageClient(api, debtorClient._Language, debtorEmailType); var debtorTransOpen = selectedItem.ChildRecords.Cast <DebtorTransOpenClient>().ToList(); debtorClient.OpenTransactions = debtorTransOpen; string _reportName = StandardReportUtility.GetLocalizedReportName(debtorClient, companyClient, debtorEmailType.ToString()); debtorCollectionReportClient = new DebtorCollectionReportClient(companyClient, debtorClient, dueDate, logo, this.AddInterest, _reportName, debtorMessageClient); return(debtorCollectionReportClient); }