Hi Duane, I'm using php with nusoap to insert a new Invoice. It works if I do not include any <Lines><anyType>.... items, but if i Include any <Lines>.. i get an error stating [StatusDetail] => Unable to cast object of type 'System.Object' to type 'KashFlow.InvoiceLine' following is the parameter format $invarr = array( 'UserName'=>$username, 'Password'=>$password, 'Inv'=>array( 'InvoiceNumber'=>25, 'InvoiceDate'=>$date->format(DATE_RFC3339), 'DueDate'=>$date->format(DATE_RFC3339), 'CustomerID'=>434366, 'Lines'=>array( 'anyType'=>array( 'Quantity'=>150.0000, 'Description'=>'Test', 'Rate'=>30.0000, 'ChargeType'=>812270, 'VatRate'=>21.0000 ) ) ) ); When using the above the values in <anyType> element are removed i.e <Lines><anyType></anyType></Lines> is what actually goes as part of the request to the webservice. I started testing the api today and was pretty happy when I got things working quickly today but this issue has me stumped. i'm praying that you dont ask me to formulate the whole XML request manually.
There are a few people who have commented on having difficulties with Invoice lines from PHP. We should have a new stand alone function by the end of the week to add lines to an invoice. Duane
I was having this problem too originally. I had to upgrade the soap lib I'm using (soap4r) to get an option to generate explicit types. This added an xsi:type='InvoiceLine' to the anyType element and that got it working for me. Cheers, Chris
Okay we have a slight problem. InsertInvoiceLine does its job if I use an existing Invoice with atleast one InvoiceLine item, but my issue is with GetInvoice functions. Any invoice without any line item returns with 0 as the InvoiceDBID and InvoiceNumber i.e [InvoiceDBID] => 0 [InvoiceNumber] => 0 Because of this I cannot use InsertInvoiceLine function I've tried using GetInvoice and GetInvoicesForCustomer
Any Solution ? Hi Guys, Any idea why i'm getting '0' values for InvoiceID and InvoiceNumber for any invoices without an InvoiceLine item ? Pratheesh
pratheesh, The GetInvoiceByID bug has been fixed and you're now able to see the invoice details even if there's no invoice line. I've also added an invoice line to an invoice without any any lines and it works without any errors. Have a look at the return value, it should return the new invoice line id.
Hi Sandy, Thats Excellent. Just tested it and its working perfectly. I'm happy Just an afterthought- Currently InsertInvoice returns the InvoiceNumber , whereas the InsertInvoiceLine requires the InvoiceID. This means i have to make an additional call to GetInvoice. This could be removed if the InsertInvoice function would also return the InvoiceID. Thanks and Regards, Pratheesh
Hi Pratheesh, Changing existing functions will break other peoples integrations. The best thing for us to do would be to change the InsertInvoiceLine to take an invoice number instead of an ID I think. Duane
Hi Duane, You are right. Changing the InsertInvoiceLine will be better. That will solve the problem. Pratheesh
Just thought of something. I remember someone mentioning potential problem with client changing the InvoiceNumber. Eventhough this wouldnt be an issue for us, but still it might be an idea to create a new function InsertInvoiceLinebyNumber/ID to provide both option.
New WebMethods Pratheesh Tried to email (x3) earlier on today and it seems like your mail server is down or something. Just wanted to let you know that WebMethods you require have been added to the API. They are: GetReceipts GetJournals
Hi Chris, What did you do to get this?! I am setting @port.generate_explicit_type = true And still don't get anything. I believe I have the latest soap4r.
Hi Phil, I built a svn version of soap4r from http://dev.ctor.org/svn/soap4r/branches/1_5 I have r2010, though r2008 is the one with the fix. http://dev.ctor.org/soap4r/ticket/449 Cheers, Chris
Thanks! Downloading and installing from svn worked. I had assumed that this fix was in the latest gem as supposedly it was done 4 months ago! Phil