Dovico.TrackITAPI.CReceivable.Save(System.String,Dovico.TrackITAPI.CStateInfo)
Function Overview:
Saves receivable information in the form receivable.xsd. To post an invoice, call this method as per normal with the POST attribute set to T for each receivable you wish to post. Information for payment, as well as what time entries and expenses belong/do not belong in receivable. Before an invoice is posted these time entry and expense IDs represent time and expenses not included in the receivable. Once the receivable has been posted they reflect all time entries/expenses that have been included.
Parameter List:
sXml - string - string of xml containing receivable information in the format receivable.xsd
siState - CStateInfo - State information needed to process the transaction
Returns
A string of xml containing the IDs of inserted and updated items.
Example:
// build up xml to create a receivable
string sXml = "<Receivable:RECEIVABLES xmlns:Receivable=\"http://www.dovico.com/schemas/receivable.xsd\">";
sXml += "<RECEIVABLE ID=\"-1\" PROJECT=\"100\" DATE=\"2003-01-01T00:00:00\" ";
sXml += "NUMBER=\"example\" FROM=\"2003-01-01T00:00:00\" TO=\"2004-01-01T00:00:00\" ";
sXml += "ATT=\"Attn: John Doe\" DESC=\"invoice description\" CONTACT=\"John Doe\" ";
sXml += "CLIDESC=\"Client Description\" EXTRA1=\"Extra 1\" EXTRA2=\"Extra 2\" ";
sXml += "ARCHIVE=\"F\" OUTSIDE=\"\" HIDE=\"F\">";
// build up xml to note any time and expense IDs excluded from this receivable
sXml += "<INVTRANS><ID>100</ID><ID>101</ID></INVTRANS><INVEXP><ID>100</ID><ID>101</ID></INVEXP>";
// build up xml to save payment information on the receivable
sXml += "<PAYMENTS><PAYMENT ID=\"-1\" AMOUNT=\"100\" DATE=\"2003-06-01T00:00:00\" CHECKNO=\"test\"/>";
sXml += "</PAYMENTS></RECEIVABLE></Receivable:RECEIVABLES>";
// call the ReceivableSave method
wsapi.MethodInvoke("ReceivableSave", sXml, stToken);