I am using the .NET API with C# with great success.
Although, the performance is really bad, so I decided to cut the number of calls to the server.
I am trying to create an invoice.
Normally it's done;
ICurrentInvoice _order = session.CurrentInvoice.Create(debtor);
ICurrentInvoiceLine _orderLine = session.CurrentInvoiceLine.Create(_order);
// Add Invoiceline data for all invoice lines..
Now I would like to use the data object.
It all works fine, but I cannot find a way to make a new invoiceline, without making a reference to the ICurrentInvoice?
Shouldn't there be a way to make a new ICurrentInvoiceLineData, [u:1nwf8x7y]without [/u:1nwf8x7y]a ICurrentInvoice?
Because at the place i write HERE below, we do not have any ICurrentInvoice yet.
So then I either need to make a call to the server to make the invoice, but at this point I don't know the gross amount, so the invoice data would be completely wrong. Then I would need to get the invoice back at the end and alter the data. Stupid way, so it cannot be like this
So, please help me - how do I make ICurrentInvoiceLineData WITHOUT any reference to ICurrentInvoice?
ICurrentInvoiceData _order = session.CurrentInvoiceData.Create(debtor);
I would like to do..
ICurrentInvoiceLineData _ild = session.Create.... // or ... new ICurrentInvoiceLineData(_order -- which is a reference to InvoiceData)..
ICurrentInvoiceLineData _ild = new ICurrentInvoiceLineData();
_ild.Invoice = _order;
yeah.. you got the point..
//Book it and fetch the new object
ICurrentInvoice _orderBooked = session.CreateInvoiceFromData(_order).Book()