Add some existing examples
This commit is contained in:
29
dotnet/uniconta/CreateInvoiceReportPdf.cs
Normal file
29
dotnet/uniconta/CreateInvoiceReportPdf.cs
Normal file
@@ -0,0 +1,29 @@
|
||||
public async Task CreateOfferReport(CrudAPI api, GiftProject giftProject)
|
||||
{
|
||||
var order = ConvertProjectToOrder(giftProject);
|
||||
|
||||
var invoiceParams = new InvoiceParameters()
|
||||
{
|
||||
Date = DateTime.Now,
|
||||
InvoiceNumber = order.Name,
|
||||
order = order,
|
||||
lines = order.OfferLines,
|
||||
ReturnPDF = true,
|
||||
SendByOutlook = false,
|
||||
SendXML = false,
|
||||
DocumentType = CompanyLayoutType.Offer,
|
||||
ShowInvoice = false,
|
||||
Simulate = false
|
||||
};
|
||||
var invoice = await invoiceParams.PostInvoice(new InvoiceAPI(api));
|
||||
var data = invoice.pdf;
|
||||
|
||||
var fileName = "Offerte 123";
|
||||
var attachment = new UserDocsClient()
|
||||
{
|
||||
_Data = data,
|
||||
_Text = fileName,
|
||||
_DocumentType = FileextensionsTypes.PDF
|
||||
};
|
||||
return attachment;
|
||||
}
|
||||
Reference in New Issue
Block a user