private static async Task <IPrintReport> StandardPrint(CreditorInvoiceClient creditorInvoice, CrudAPI crudApi) { var creditorInvoicePrint = new UnicontaClient.Pages.CreditorPrintReport(creditorInvoice, crudApi); var isInitializedSuccess = await creditorInvoicePrint.InstantiateFields(); if (isInitializedSuccess) { var standardCreditorInvoice = new CreditorStandardReportClient(creditorInvoicePrint.Company, creditorInvoicePrint.Creditor, creditorInvoicePrint.CreditorInvoice, creditorInvoicePrint.InvTransInvoiceLines, creditorInvoicePrint.CreditorOrder, creditorInvoicePrint.CompanyLogo, creditorInvoicePrint.ReportName, (int)Uniconta.ClientTools.Controls.Reporting.StandardReports.PurchaseInvoice, creditorInvoicePrint.CreditorMessage, creditorInvoicePrint.IsCreditNote); var iprintReport = new StandardPrintReport(crudApi, new[] { standardCreditorInvoice }, (byte)Uniconta.ClientTools.Controls.Reporting.StandardReports.PurchaseInvoice) { UseReportCache = true }; await iprintReport.InitializePrint(); if (iprintReport.Report != null) { return(iprintReport); } var layoutReport = new LayoutPrintReport(crudApi, creditorInvoice); await layoutReport.InitializePrint(); return(layoutReport); } return(null); }
private static async Task <IPrintReport> StandardPrint(CreditorInvoiceClient creditorInvoice, CrudAPI crudApi) { IPrintReport iprintReport = null; var creditorInvoicePrint = new UnicontaClient.Pages.CreditorPrintReport(creditorInvoice, crudApi); var isInitializedSuccess = await creditorInvoicePrint.InstantiaeFields(); if (isInitializedSuccess) { var standardCreditorInvoice = new CreditorStandardReportClient(creditorInvoicePrint.Company, creditorInvoicePrint.Creditor, creditorInvoicePrint.CreditorInvoice, creditorInvoicePrint.InvTransInvoiceLines, null, creditorInvoicePrint.CompanyLogo, creditorInvoicePrint.ReportName, (int)Uniconta.ClientTools.Controls.Reporting.StandardReports.PurchaseInvoice); var standardReports = new ICreditorStandardReport[1] { standardCreditorInvoice }; iprintReport = new StandardPrintReport(crudApi, standardReports, (byte)Uniconta.ClientTools.Controls.Reporting.StandardReports.PurchaseInvoice); await iprintReport.InitializePrint(); if (iprintReport?.Report == null) { iprintReport = new LayoutPrintReport(crudApi, creditorInvoice); await iprintReport.InitializePrint(); } } return(iprintReport); }